:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --ink: #17140f;
  --ink-soft: #2a241d;
  --muted: #716b60;
  --line: #e7e1d4;
  --accent: #2f6f62;
  --accent-soft: #4ea88f;
  --accent-ink: #fffaf3;
  --dark: #2a2419;
  --dark-surface: #1f1b15;
  --cream: #f3ede1;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 999px;
  --font-display: 'Koh Santepheap', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* subtle film-grain texture for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

em { font-style: italic; color: inherit; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 243, 0.7);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), padding 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(250, 248, 243, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  transition: height 0.3s var(--ease);
}

.site-header.is-scrolled .header-inner { height: 64px; }

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-dot { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav a span { position: relative; }

.nav a span::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.nav a:hover span::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 28px 0 20px;
}

.hero-glow {
  position: absolute;
  top: -30%;
  right: -10%;
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, rgba(47, 111, 98, 0.16) 0%, rgba(47, 111, 98, 0) 68%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 30ch;
}

@media (max-width: 480px) {
  .hero-break { display: none; }
}

.hero-tagline {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 50ch;
  font-family: var(--font-display);
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  isolation: isolate;
}

.btn span { position: relative; z-index: 1; transition: color 0.3s var(--ease); }
.btn i { position: relative; z-index: 1; font-style: normal; transition: transform 0.3s var(--ease), color 0.3s var(--ease); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
  z-index: 0;
}
.btn-primary:hover::before { transform: translateY(0); }
.btn-primary:hover i { transform: translateY(2px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost:hover i { transform: translate(2px, -2px); color: var(--accent); }

/* ---------- Section shared ---------- */
.section-head { max-width: 640px; margin-bottom: 56px; }

.section-head-center {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--muted);
  margin: 0;
  font-size: 1.08rem;
}

.prototypes { padding: 60px 0 65px; }

/* ---------- Project feature ---------- */
.project-feature {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}

.project-media { position: relative; }

.browser-frame {
  background: var(--dark-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(21, 18, 14, 0.35), 0 10px 24px -12px rgba(21, 18, 14, 0.25);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.project-media:hover .browser-frame {
  transform: translateY(-6px);
  box-shadow: 0 40px 90px -18px rgba(21, 18, 14, 0.42), 0 14px 30px -10px rgba(21, 18, 14, 0.3);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--dark-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-dots { display: flex; gap: 5px; flex-shrink: 0; }
.browser-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: block;
}

.browser-url {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-body {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
}

.browser-body iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 222%;
  height: 222%;
  border: 0;
  transform: scale(0.4505);
  transform-origin: top left;
  pointer-events: none;
}

.media-overlay-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}
.media-overlay-link i { font-style: normal; transition: transform 0.3s var(--ease); }
.media-overlay-link:hover i { transform: translate(2px, -2px); color: var(--accent); }
.media-overlay-link:hover { color: var(--accent); }

.project-content { display: flex; flex-direction: column; gap: 16px; }

.project-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-content h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2.1rem;
  letter-spacing: -0.01em;
}

.project-desc {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 44ch;
}

.project-desc a {
  color: var(--ink-soft);
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
  transition: color 0.25s var(--ease), text-decoration-color 0.25s var(--ease);
}
.project-desc a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
}

.project-tags li {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 13px;
}

.project-links {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.project-links a i { font-style: normal; transition: transform 0.3s var(--ease); }
.project-links a:hover { color: var(--accent); border-color: var(--accent); }
.project-links a:hover i { transform: translate(2px, -2px); }

.project-feature + .project-feature { margin-top: 110px; }

.project-feature.is-reversed .project-media { order: 2; }
.project-feature.is-reversed .project-content { order: 1; }

.browser-body--image { aspect-ratio: auto; }
.browser-body--image img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 880px) {
  .project-feature { grid-template-columns: 1fr; gap: 36px; }
  .project-feature.is-reversed .project-media { order: 1; }
  .project-feature.is-reversed .project-content { order: 2; }
}

/* ---------- About (dark statement section) ---------- */
.about {
  background: var(--dark);
  color: var(--cream);
  padding: 75px 0;
  position: relative;
  overflow: hidden;
}

.about::before {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle, rgba(78, 168, 143, 0.14) 0%, rgba(78, 168, 143, 0) 70%);
  pointer-events: none;
}

.about-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.eyebrow-light {
  color: var(--accent-soft);
}
.eyebrow-center { justify-content: center; }

.about-statement {
  margin: 0 auto;
  max-width: 820px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--cream);
}

.about-statement em {
  color: var(--accent-soft);
  font-style: italic;
}

@media (max-width: 640px) {
  .about-statement { max-width: 100%; }
}

.about-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.about-links a {
  color: rgba(243, 237, 225, 0.75);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.25s var(--ease);
}
.about-links a:hover { color: var(--accent-soft); }

.nav a { white-space: nowrap; }
.brand { white-space: nowrap; }

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .brand { font-size: 1.05rem; }
  .nav { gap: 12px; }
}

@media (max-width: 420px) {
  .nav { gap: 8px; }
  .nav a span { font-size: 0.82rem; }
}

/* ---------- Password gate (Prototypes section) ---------- */
.proto-cards.is-locked {
  display: none;
}

.proto-gate.is-unlocked {
  display: none;
}

.proto-gate {
  display: flex;
  justify-content: center;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.gate-box {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.gate-label {
  color: var(--muted);
  font-size: 0.94rem;
  margin: 0 0 20px;
}

.gate-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 12px;
}
.gate-input:focus {
  outline: none;
  border-color: var(--accent);
}

.gate-submit {
  width: 100%;
  justify-content: center;
}

.gate-error {
  color: var(--accent);
  font-size: 0.86rem;
  margin: 14px 0 0;
}
