:root {
  --navy: #090d16;
  --navy-2: #131d31;
  --blue: #4db8ff;
  --blue-soft: #6ecbff;
  --steel: #9aa7b8;
  --text: #f2f4f7;
  --header-h: 116px;
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.6;
}

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(10,15,26,0.85), transparent);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 0 24px;
}
.logo { flex-shrink: 0; }
.logo img { height: 88px; width: auto; display: block; border-radius: 3px; }
.main-nav { display: flex; gap: 32px; margin-left: auto; margin-right: 32px; }
.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
}
.main-nav a:hover { opacity: 1; color: var(--blue-soft); }
.lang-toggle {
  background: transparent;
  border: 1px solid var(--steel);
  color: var(--text);
  padding: 6px 14px;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.lang-toggle:hover { border-color: var(--blue); color: var(--blue-soft); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  width: min(100%, calc(100vh * 1084 / 720));
  aspect-ratio: 1084 / 720;
  overflow: hidden;
  background: var(--navy);
  margin: 0 auto;
  /* --hw is set in px by script.js (ResizeObserver) to the hero's own
     rendered width, so every text measurement below scales perfectly
     smoothly and continuously with it — no container-query step
     artifacts, no fixed-px breakpoints. Fallback keeps things sane
     before JS runs / if JS is unavailable. */
  --hw: 1084px;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
}
.hero-title {
  position: absolute;
  z-index: 1;
  left: calc(23% - (var(--hw) * 0.055));
  top: 32%;
  max-width: calc(var(--hw) * 0.39);
  font-size: calc(var(--hw) * 0.0472);
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  white-space: nowrap;
  opacity: 0;
  animation: hero-text-in 1.2s ease-out forwards;
  animation-delay: 4.7s;
}
.title-top { display: block; }
.title-bottom { display: block; }
.title-rule {
  display: block;
  width: calc(var(--hw) * 0.11);
  height: 0;
  margin: calc(var(--hw) * 0.01) 0;
}
.hero-tagline {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 77%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: calc(var(--hw) * 0.0166);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
  text-align: center;
  opacity: 0;
  animation: hero-text-in 1.2s ease-out forwards;
  animation-delay: 6.2s;
}
@keyframes hero-text-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections */
.section {
  padding: 100px 24px;
  min-height: 90vh;
  display: flex;
  align-items: center;
  scroll-margin-top: var(--header-h);
}
.section.alt { background: var(--navy-2); }
.section-inner { max-width: 900px; margin: 0 auto; width: 100%; }
.section h2 {
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 24px;
  color: var(--text);
  border-left: 3px solid var(--blue);
  padding-left: 16px;
}
.section p {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  color: var(--steel);
  max-width: 640px;
}
.about-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.about-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blue);
  flex-shrink: 0;
}
.about-name {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 19px;
  color: var(--blue-soft);
  letter-spacing: 0.03em;
  margin-bottom: 0;
}
#about p:not(.about-name) {
  margin-bottom: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 16px;
}
.project-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 24px;
  border-radius: 4px;
}
.project-card h3 {
  font-weight: 400;
  font-size: 19px;
  margin-bottom: 10px;
  color: var(--blue-soft);
}
.project-card p {
  font-size: 14px;
  color: var(--steel);
  max-width: none;
}

.signature {
  margin-top: 24px;
  color: var(--text);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
.signature a {
  color: var(--blue-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(110,203,255,0.4);
}
.signature a:hover { border-bottom-color: var(--blue-soft); }

.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--steel);
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 700px) {
  :root { --header-h: 64px; }

  .header-inner { gap: 12px; padding: 0 16px; }
  .logo img { height: 40px; }
  .lang-toggle { padding: 5px 12px; font-size: 12px; }
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    background: rgba(9, 13, 22, 0.97);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: 16px 24px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    opacity: 1;
  }

  .hero {
    width: 100%;
    aspect-ratio: auto;
    height: 100svh;
  }
  .hero-video { object-fit: cover; object-position: center top; }
  .hero-title {
    left: 8%;
    top: auto;
    bottom: 32%;
    max-width: 84%;
    font-size: clamp(30px, 9.5vw, 42px);
    white-space: normal;
  }
  .title-rule { width: 60px; height: 0; margin: 10px 0; }
  .hero-tagline {
    top: auto;
    bottom: 15%;
    left: 8%;
    transform: none;
    white-space: normal;
    max-width: 84%;
    font-size: clamp(11px, 3.2vw, 13px);
  }

  .section { padding: 64px 20px; min-height: auto; }
  .section h2 { font-size: 22px; margin-bottom: 18px; }
  .project-grid { grid-template-columns: 1fr; gap: 20px; }
  .about-header { flex-wrap: wrap; }
}

/* Phones in landscape (rotated on the side). Scoped to touch devices with a
   short viewport (hover:none + pointer:coarse), so a laptop window never
   matches this — even if resized short — and the desktop layout above stays
   exactly as-is. */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  :root { --header-h: 48px; }

  .header-inner { gap: 10px; padding: 0 16px; }
  .logo img { height: 30px; }
  .lang-toggle { padding: 4px 10px; font-size: 11px; }
  .nav-toggle { display: flex; width: 26px; height: 26px; }
  .nav-toggle span { width: 18px; }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    flex-direction: column;
    gap: 0;
    margin: 0;
    background: rgba(9, 13, 22, 0.97);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: 10px 24px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  /* Keep the native 1084:720 aspect ratio (same as desktop) so the video is
     never cropped — but force full screen width instead of the desktop rule
     (min(100%, 100vh * ratio)), which on a short landscape screen computes
     narrower than the screen and leaves side margins. On a short landscape
     screen the resulting box can end up taller than the visible viewport —
     the visitor just scrolls a bit further, nothing is lost. */
  .hero { width: 100%; }
  .hero-title {
    left: 8%;
    top: auto;
    bottom: 24%;
    max-width: 70%;
    font-size: clamp(20px, 6vw, 30px);
    white-space: normal;
  }
  .title-rule { width: 44px; height: 0; margin: 6px 0; }
  .hero-tagline {
    top: auto;
    bottom: 10%;
    left: 8%;
    transform: none;
    white-space: normal;
    max-width: 70%;
    font-size: clamp(9px, 2.4vw, 11px);
  }

  .section { padding: 32px 20px; min-height: auto; }
  .section h2 { font-size: 20px; margin-bottom: 14px; }
  .project-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
}
