/* A fixed icon rail on desktop; the same links become a labelled mobile menu. */
.header-contact { display: none; }
.nav-icon { display: grid; place-items: center; flex-shrink: 0; }
.nav-icon svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#navigation .nav-label { font-size: inherit; }

@media (min-width: 801px) {
  :root { --rail-width: 88px; --gutter: clamp(30px, 4.5vw, 88px); }
  main { margin-left: var(--rail-width); }
  .site-header { left: var(--rail-width); }
  .header-contact {
    display: inline-flex;
    align-items: center;
    gap: 26px;
    border: 1px solid #b7a588;
    padding: 12px 20px;
    font-size: 12px;
    line-height: 1.5;
    transition: background .2s;
  }
  .header-contact span { font-size: 20px; }
  .header-contact:hover { background: var(--cream); }
  #navigation {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-width);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    padding: 24px 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--navy);
    color: #cbd3d2;
    border-right: 1px solid #ffffff17;
    z-index: 21;
    transition: width .24s ease, box-shadow .24s ease;
  }
  #navigation > a {
    display: flex;
    align-items: center;
    flex: 0 0 54px;
    width: 238px;
    min-height: 54px;
    padding: 0;
    margin: 0;
    gap: 0;
    border: 0;
    font-size: 13px;
    line-height: 1.4;
    transition: color .2s, background .2s;
  }
  #navigation .nav-icon { width: var(--rail-width); height: 54px; }
  #navigation .nav-label {
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .16s ease, transform .24s ease;
  }
  #navigation > a::after {
    content: '';
    position: absolute;
    inset: 15px auto 15px 0;
    width: 2px;
    height: auto;
    background: #d0b184;
    opacity: 0;
    transition: opacity .2s;
  }
  #navigation > a:hover, #navigation > a:focus-visible,
  #navigation > a[aria-current="location"] {
    color: #e2c394;
    background: #ffffff07;
  }
  #navigation > a[aria-current="location"]::after { opacity: 1; }
  #navigation > a:focus-visible { outline-offset: -5px; }
  #navigation > .nav-contact { margin-top: 22px; }
  #navigation:focus-within { width: 238px; box-shadow: 12px 0 32px #102a3820; }
  #navigation:focus-within .nav-label { opacity: 1; transform: none; }
  .skip-link { left: calc(var(--rail-width) + 16px); }
  .hero h1 { font-size: clamp(32px, 4.1vw, 64px); }
}

@media (min-width: 801px) and (hover: hover) {
  #navigation:hover { width: 238px; box-shadow: 12px 0 32px #102a3820; }
  #navigation:hover .nav-label { opacity: 1; transform: none; }
}

/* Wide touch screens keep labels visible without relying on a hover gesture. */
@media (min-width: 801px) and (hover: none) {
  #navigation > a { flex-direction: column; width: var(--rail-width); min-height: 67px; flex-basis: 67px; }
  #navigation .nav-icon { height: 36px; }
  #navigation .nav-label { opacity: 1; transform: none; white-space: normal; text-align: center; font-size: 9px; padding: 0 5px; }
  #navigation:focus-within { width: var(--rail-width); box-shadow: none; }
}

@media (min-width: 801px) and (max-width: 1050px) {
  :root { --rail-width: 76px; --gutter: 30px; }
  .hero h1 { font-size: clamp(28px, 3.7vw, 38px); }
  .values-strip { gap: 12px; }
  .values-strip p { font-size: 10px; gap: 8px; }
  .services, .about, .contact { gap: 6%; }
}

@media (min-width: 801px) and (max-height: 480px) {
  #navigation { justify-content: flex-start; padding-block: 12px; gap: 2px; }
  #navigation > .nav-contact { margin-top: 8px; }
}

@media (max-width: 800px) {
  #navigation {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100vh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition:
      transform 280ms cubic-bezier(.22, 1, .36, 1),
      opacity 200ms ease,
      visibility 0s linear 280ms;
  }
  #navigation.is-open {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
  }
  #navigation > a { display: flex; align-items: center; flex-shrink: 0; min-height: 48px; gap: 16px; padding: 10px 12px; }
  #navigation .nav-icon { width: 24px; }
  #navigation .nav-contact { justify-content: flex-start; }
  #navigation > a::after { display: none; }
  #navigation > a[aria-current="location"] { background: var(--cream); color: var(--navy); }

  /* Both strokes always exist, allowing the hamburger and cross to morph. */
  .site-header .menu-toggle .menu-lines { width: 24px; height: 18px; border: 0; }
  .site-header .menu-toggle .menu-lines::before,
  .site-header .menu-toggle .menu-lines::after {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 24px;
    height: 1px;
    background: var(--navy);
    transition: transform 280ms cubic-bezier(.22, 1, .36, 1);
  }
  .site-header .menu-toggle .menu-lines::before { transform: translateY(-4px); }
  .site-header .menu-toggle .menu-lines::after { transform: translateY(4px); }
  .site-header .menu-toggle[aria-expanded="true"] .menu-lines::before { transform: rotate(45deg); }
  .site-header .menu-toggle[aria-expanded="true"] .menu-lines::after { transform: rotate(-45deg); }
}

@media print {
  main { margin-left: 0; }
  .site-header { left: auto; }
  #navigation, .header-contact, .menu-toggle { display: none; }
}
