
@media all and (orientation:portrait) {

  :root {
    --bg-primary: #faf8f3;
    --bg-secondary: #f5f3ed;
    --text-primary: #2a2520;
    --text-secondary: #6b6459;
    --accent-primary: #8b7d5b;
    --accent-light: #a89968;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 12px rgba(42, 37, 32, 0.08);
    --card-shadow-hover: 0 4px 20px rgba(42, 37, 32, 0.12);
  }

  * {
    box-sizing: border-box;
  }

  body {
    font-size: 16px;
    line-height: 1.8;
    font-weight: 400;
  }

  #undercons {
    position: fixed;
    top: auto;
    margin: 0;
    z-index: 100;
    bottom: 0px;
    right: -50px;
    bottom: -50px;
  }

  #cv div span {
    display: none;
  }
  
  #cv ul li span {
    display: none;
  }

  .content {
    visibility: visible;
    position: relative;
    margin: 0;
    padding: 0;
  }

  h1 {
    padding-top: 0;
    font-size: 2.2rem;
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
  }

  h2 {
    font-size: 1.75rem;
    margin: 1.5rem 0 1rem 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
  }

  h3 {
    font-size: 1.25rem;
    margin: 1rem 0 0.75rem 0;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text-primary);
  }

  p {
    margin: 0.75rem 0;
    line-height: 1.85;
    color: var(--text-secondary);
    font-weight: 400;
  }

  .firstslide {
    padding: 100px 24px 80px 24px;
    text-align: center;
    margin-bottom: 40px;
  }

  .firstslide h1 {
    font-size: 2.5rem;
    margin: 0.5rem 0 1rem 0;
  }

  .firstslide p {
    font-size: 1.15rem;
    margin: 1rem 0;
    line-height: 1.9;
    font-weight: 400;
  }

  .firstslide > div {
    margin-top: 32px;
  }

  .cvrsection {
    border-radius: 12px;
    margin: 20px 0;
    padding: 20px;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--accent-primary);
    transition: all 0.3s ease;
  }

  .cvrsection:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
  }

  .cvrsection h1 {
    font-size: 1.75rem;
    margin-top: 0;
  }

  #home {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 56px);      /* occupy the full screen */
  margin: 0;
  padding: 0 24px;

  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center content */
  align-items: center;     /* horizontally center content */
  text-align: center;
}

  main {
    font-size: 20px;
  }

  main section {
    margin-bottom: 20px;
  }

  header {
    visibility: hidden;
  }

  section {
    padding-top: 20px;
    padding-left: 24px;
    padding-bottom: 60px;
    padding-right: 24px;
    width: auto;
  }

  /* Touch-friendly button sizing */
  a[style*="border-radius"],
  .btn {
    min-height: 48px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Primary action button */
  a[href*="matteolionello_cv.pdf"] {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(139, 125, 91, 0.25);
    border: none;
    margin: 8px 8px;
  }

  a[href*="matteolionello_cv.pdf"]:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(139, 125, 91, 0.15);
  }

  /* Secondary action buttons */
  a[href*="linkedin.com"],
  a[href*="github.com"] {
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    background: white;
    box-shadow: none;
    margin: 8px 8px;
  }

  a[href*="linkedin.com"]:active,
  a[href*="github.com"]:active {
    background: rgba(139, 125, 91, 0.08);
    transform: scale(0.98);
  }

  /* Social icons footer */
  .icons {
    float: right;
    margin-top: 8px;
    margin-right: 16px;
    transition: all 0.3s ease;
  }

  .icons img {
    width: 48px;
    opacity: 0.8;
    box-shadow: 0 2px 6px rgba(42, 37, 32, 0.1);
    transition: all 0.3s ease;
    border-radius: 4px;
  }

  .icons img:active {
    opacity: 1;
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(42, 37, 32, 0.15);
  }

  footer div {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    color: var(--bg-primary);
    background-color: var(--text-primary);
    box-shadow: 0 -4px 16px rgba(42, 37, 32, 0.15);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 99;
    font-size: 12px;
  }

  #spanfooter {
    float: none;
    padding: 0;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.9;
  }

  .showmeinmobile {
    display: block;
  }

  .showmeinmobile h1 {
    margin-top: 0;
    padding-top: 0;
  }

  .cvrsection hr {
    visibility: hidden;
    margin: 0;
    padding: 0;
    height: 0;
  }

  /* List improvements */
  #projects h3 {
    margin-left: 0;
    padding-left: 0;
    list-style-position: inside;
  }

  #projects p {
    padding-left: 0;
    margin-left: 0.5rem;
  }

  #contacts span a img {
    width: 15%;
    padding: 24px;
    opacity: 0.85;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  }

  #contacts span a:active img {
    opacity: 1;
    transform: scale(0.95);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  }

  /* Content spacing */
  .content section {
    padding-bottom: 40px;
  }

  .content section:last-child {
    padding-bottom: 80px;
  }

  #downloadidwrapperdiv {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
  }
}
