:root {
  --pad-x: clamp(32px, 6.35vw, 132px);
  --pad-y: clamp(30px, 7.2vh, 92px);
  --white: rgba(255,255,255,.97);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: #111; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  color: var(--white);
  background: #101010;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}
.hero__image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.001);
  user-select: none;
  -webkit-user-drag: none;
}

/* Very light contrast support; intentionally almost invisible. */
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.04), rgba(0,0,0,.015) 55%, rgba(0,0,0,.08));
}

.brand {
  position: absolute;
  left: var(--pad-x);
  bottom: clamp(50px, 5.9vh, 76px);
  width: clamp(240px, 19.6vw, 402px);
  line-height: 0;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 12;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.menu-toggle {
  position: absolute;
  top: clamp(50px, 5.9vh, 76px);
  right: var(--pad-x);
  width: 54px;
  height: 54px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  z-index: 20;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle__glyph,
.menu-toggle__glyph::before,
.menu-toggle__glyph::after { display: block; }

.menu-toggle__glyph {
  position: relative;
  width: 56px;
  height: 56px;
  animation: pulseHint 1.9s ease-in-out infinite;
  transition: transform 260ms cubic-bezier(.22,.61,.36,1);
}
.menu-toggle__glyph::before,
.menu-toggle__glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}
.menu-toggle__glyph::before { width: 54px; height: 1.5px; }
.menu-toggle__glyph::after  { width: 1.5px; height: 54px; }

.menu-toggle.is-open .menu-toggle__glyph {
  transform: rotate(45deg);
  animation: none;
  opacity: 1;
}

@keyframes pulseHint {
  0%, 100% { opacity: .34; }
  50% { opacity: 1; }
}

.menu {
  position: absolute;
  top: clamp(165px, 14.8vh, 192px);
  right: var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(10px, 1.1vh, 17px);
  z-index: 10;
  pointer-events: none;
}

.menu a {
  font-size: clamp(22px, 1.62vw, 34px);
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: .055em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(38px);
  transition:
    opacity 180ms ease-out,
    transform 260ms cubic-bezier(.22,.61,.36,1);
  transition-delay: calc(var(--i) * 72ms);
}

.menu.is-open { pointer-events: auto; }
.menu.is-open a {
  opacity: 1;
  transform: translateX(0);
}

.menu:not(.is-open) a {
  transition-delay: 0ms;
  transition-duration: 110ms;
}

.menu a:hover,
.language a:hover { opacity: .68; }

.language {
  position: absolute;
  right: var(--pad-x);
  bottom: clamp(50px, 5.9vh, 76px);
  z-index: 10;
  display: flex;
  gap: .42em;
  align-items: center;
  font-size: clamp(12px, .735vw, 15.5px);
  line-height: 1;
  font-weight: 300;
  letter-spacing: .03em;
  user-select: none;
}
.language a, .language span { transition: opacity 150ms ease; }
.language a:not(.is-active), .language span { opacity: .9; }

/* ---------------- MOBILE HOME ----------------
   iPhone 17 Pro Max (440 × 956 CSS px) is the art-direction reference,
   but all dimensions remain fluid for smaller/larger iPhones. */
@media (max-width: 800px) {
  :root {
    --mobile-edge: clamp(24px, 6.35vw, 30px);
  }

  html, body { height: 100%; }

  .hero {
    height: 100svh;
    min-height: 0;
  }

  /* Keep the original landscape render intact and look through it as a vertical window.
     It starts left-aligned, then pans until the image's right edge reaches the viewport. */
  .hero__image img {
    inset: 0 auto 0 0;
    width: auto;
    max-width: none;
    height: 100%;
    object-fit: initial;
    object-position: initial;
    transform: translate3d(0,0,0);
    will-change: transform;
    animation: mobileHeroPan 46s cubic-bezier(.18,.56,.25,1) .35s forwards;
  }

  @keyframes mobileHeroPan {
    from { transform: translate3d(0,0,0); }
    to   { transform: translate3d(calc(100vw - 100%),0,0); }
  }

  .hero__shade {
    background:
      linear-gradient(to bottom, rgba(0,0,0,.055), rgba(0,0,0,.012) 54%, rgba(0,0,0,.16)),
      linear-gradient(to right, rgba(0,0,0,.045), transparent 42%, rgba(0,0,0,.025));
  }

  /* Same left margin as the menu's right margin. */
  .brand {
    left: var(--mobile-edge);
    bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(142px, 16.2svh, 164px));
    width: min(53vw, 232px);
  }

  .language {
    left: var(--mobile-edge);
    right: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(103px, 11.5svh, 116px));
    font-size: clamp(10px, 2.6vw, 11px);
    opacity: .72;
  }

  .menu-toggle {
    top: calc(env(safe-area-inset-top, 0px) + 58px);
    right: var(--mobile-edge);
    width: 50px;
    height: 50px;
  }
  .menu-toggle__glyph {
    width: 44px;
    height: 44px;
  }
  .menu-toggle__glyph::before { width: 43px; height: 1.25px; }
  .menu-toggle__glyph::after  { width: 1.25px; height: 43px; }

  .menu {
    top: calc(env(safe-area-inset-top, 0px) + 170px);
    right: var(--mobile-edge);
    gap: clamp(14px, 1.75svh, 18px);
  }

  .menu a {
    font-size: clamp(19px, 5.15vw, 23px);
    line-height: 1;
    letter-spacing: .01em;
    transform: translateX(30px);
    transition:
      opacity 540ms ease-out,
      transform 780ms cubic-bezier(.22,.61,.36,1);
    transition-delay: calc(var(--i) * 216ms);
  }
}

@media (max-width: 390px) {
  .brand {
    width: min(55vw, 208px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 132px);
  }
  .language {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 95px);
  }
  .menu {
    top: calc(env(safe-area-inset-top, 0px) + 154px);
  }
  .menu a { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}


body.page-leaving-projects {
  opacity: 0;
  transition: opacity 220ms ease-out;
}


/* ================================================================
   TABLET LANGUAGE ALIGNMENT
   iPad Pro / Air / Mini, portrait + landscape only.
   Desktop and phones are untouched.
   ================================================================ */
@media (min-width: 700px) and (max-width: 1366px) and (pointer: coarse) {
  .language {
    display: flex !important;
    bottom: var(--tablet-language-bottom) !important;
  }
}


/* ================================================================
   TABLET TR/EN — FIXED PROJECTS-PAGE POSITION
   iPad Pro / Air / Mini, portrait + landscape.
   Desktop and phones untouched.
   ================================================================ */
@media (min-width: 700px) and (max-width: 1366px) {
  .language {
    display: flex !important;
    position: fixed !important;
    z-index: 55;
    top: auto !important;
    transform: none !important;
  }
}

/* mini + Air portrait */
@media (min-width: 700px) and (max-width: 900px) and (orientation: portrait) {
  .language {
    right: clamp(28px, 3.7vw, 34px) !important;
    bottom: calc(clamp(30px, 4.1vh, 38px) * .9) !important;
  }
}

/* mini landscape */
@media (min-width: 700px) and (max-width: 1060px) and (orientation: landscape) {
  .language {
    right: var(--edge-x) !important;
    bottom: calc(var(--edge-y) * .7) !important;
  }
}

/* Air landscape */
@media (min-width: 1061px) and (max-width: 1200px) and (orientation: landscape) {
  .language {
    right: var(--edge-x) !important;
    bottom: var(--edge-y) !important;
  }
}

/* Pro portrait */
@media (min-width: 901px) and (max-width: 1100px) and (orientation: portrait) {
  .language {
    right: var(--edge-x) !important;
    bottom: calc(var(--edge-y) * .6) !important;
  }
}

/* Pro landscape */
@media (min-width: 1201px) and (max-width: 1366px) and (orientation: landscape) {
  .language {
    right: var(--edge-x) !important;
    bottom: var(--edge-y) !important;
  }
}


/* ================================================================
   IPHONE LANDSCAPE v1 — HOME
   Reference: About/Contact logo + Projects menu.
   ================================================================ */
@media (min-width: 700px) and (max-width: 1000px) and (max-height: 560px) and (orientation: landscape) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .hero {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* Landscape render fills the width, leaving vertical overflow.
     Pan slowly from the top edge to the bottom edge, with no page scroll. */
  .hero__image img {
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    object-fit: initial !important;
    object-position: initial !important;
    transform: translate3d(0,0,0);
    will-change: transform;
    animation: iphoneLandscapeHeroPanY 46s cubic-bezier(.18,.56,.25,1) .35s forwards !important;
  }

  @keyframes iphoneLandscapeHeroPanY {
    from { transform: translate3d(0,0,0); }
    to   { transform: translate3d(0, calc(100svh - 100%), 0); }
  }

  /* Logo geometry = approved About / Contact landscape logo. */
  .brand {
    position: fixed !important;
    top: auto !important;
    left: clamp(40px, 6.3vw, 128px) !important;
    bottom: calc(clamp(36px, 6.8vh, 86px) * .7) !important;
    width: 116px !important;
    transform: none !important;
  }

  /* Menu geometry = Projects landscape-phone geometry. */
  .menu-toggle {
    position: fixed !important;
    top: 30px !important;
    right: 34px !important;
    width: 52px !important;
    height: 52px !important;
  }

  .menu-toggle__glyph {
    width: 48px !important;
    height: 48px !important;
  }

  .menu-toggle__glyph::before {
    width: 46px !important;
    height: 1.2px !important;
  }

  .menu-toggle__glyph::after {
    width: 1.2px !important;
    height: 46px !important;
  }

  .menu {
    position: fixed !important;
    top: 126px !important;
    right: 34px !important;
    gap: 9px !important;
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .menu a {
    font-size: 20px !important;
    line-height: 1.08 !important;
    letter-spacing: .015em !important;
  }

  /* TR / EN = Contact reference, identical on every landscape-phone page. */
  .language {
    display: flex !important;
    position: fixed !important;
    top: auto !important;
    right: 42px !important;
    bottom: calc(clamp(36px, 6.8vh, 86px) * .7) !important;
    font-size: 10px !important;
    transform: none !important;
  }
}


/* ================================================================
   DESKTOP HOME — logo consistency
   Match Projects / About / Contact exactly.
   Desktop only; tablet and phone rules remain untouched.
   ================================================================ */
@media (min-width: 1367px) {
  .brand {
    position: fixed !important;
    left: clamp(40px, 6.3vw, 128px) !important;
    bottom: clamp(36px, 6.8vh, 86px) !important;
    width: clamp(210px, 18vw, 342px) !important;
  }
}
