/* Layout: dark-first studio page. A split hero pairs the headline with a generative "strata"
   artwork; content sits on a wide grid with photographic panels and one hero product band.
   Theme: follows the device, or the visitor's choice via the header switch (data-theme). */
:root {
  --bg: #061a1d;
  --bg-2: #0a2327;
  --surface: #0e2b30;
  --line: rgba(190, 230, 222, 0.12);
  --text: #e8f1ef;
  --muted: #8fa9a6;
  --amber: #f6a623;
  --teal: #43c6b4;
  --on-amber: #1b1203;
  --shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Hanken Grotesk", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1240px;
  --gutter: max(20px, 4vw);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f6f5;
    --bg-2: #e7eeec;
    --surface: #ffffff;
    --line: rgba(10, 50, 50, 0.13);
    --text: #0a2226;
    --muted: #4c6563;
    --amber: #b86200;
    --teal: #0d7a70;
    --on-amber: #ffffff;
    --shadow: 0 40px 80px -40px rgba(6, 40, 44, 0.35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f2f6f5;
  --bg-2: #e7eeec;
  --surface: #ffffff;
  --line: rgba(10, 50, 50, 0.13);
  --text: #0a2226;
  --muted: #4c6563;
  --amber: #b86200;
  --teal: #0d7a70;
  --on-amber: #ffffff;
  --shadow: 0 40px 80px -40px rgba(6, 40, 44, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.label {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.label::before { content: ""; width: 18px; height: 1px; background: var(--amber); }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; font-weight: 700; }

/* Header */
header.site {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.brand { font: 800 26px/1 var(--display); letter-spacing: -0.04em; text-decoration: none; }
.brand span { color: var(--amber); }
.nav-group { display: flex; align-items: center; gap: 28px; }
nav { display: flex; gap: 28px; }
nav a { font-size: 15px; color: var(--muted); text-decoration: none; transition: color .2s; }
nav a:hover { color: var(--text); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.theme-toggle:hover { border-color: var(--muted); transform: rotate(-12deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .sun { display: block; }
  :root:not([data-theme]) .theme-toggle .moon { display: none; }
}

/* Hero */
.hero { border-bottom: 1px solid var(--line); }
.hero .wrap {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 5vw, 80px); align-items: center;
  padding-block: clamp(72px, 9vw, 128px);
}
.hero h1 {
  font-size: clamp(44px, 5.8vw, 86px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  margin: 26px 0 28px;
}
.hero h1 .amber { color: var(--amber); }
.hero p { font-size: clamp(18px, 1.5vw, 20px); color: var(--muted); max-width: 32em; margin: 0 0 40px; }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px;
  font: 600 16px/1 var(--body); text-decoration: none;
  background: var(--amber); color: var(--on-amber);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -14px var(--amber); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { box-shadow: none; border-color: var(--muted); }
.meta {
  display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 56px;
  font: 400 13px/1.4 var(--mono); color: var(--muted);
}
.meta b { color: var(--text); font-weight: 500; }

/* Generative strata artwork */
.strata { margin: 0; min-width: 0; }
.strata button {
  display: block; width: 100%; padding: 0; border: 0; background: var(--bg-2); cursor: pointer;
  aspect-ratio: 4 / 5; max-width: 100%; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow);
}
.strata canvas { width: 100%; height: 100%; display: block; }
.strata figcaption {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 14px;
  font: 400 12px/1.4 var(--mono); color: var(--muted); letter-spacing: .04em;
}
.strata figcaption b { color: var(--text); font-weight: 500; }
.strip { display: block; width: 100%; height: 18px; }

/* Sections */
section { padding-block: clamp(80px, 10vw, 140px); border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; align-items: end; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -0.035em; margin-top: 18px; }
.section-head p { color: var(--muted); margin: 0; max-width: 36em; }

.about-body { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.about-body .lead { font: 500 clamp(24px, 2.6vw, 34px)/1.3 var(--display); letter-spacing: -0.02em; margin: 22px 0 22px; }
.about-body p { margin: 0 0 18px; color: var(--muted); max-width: 34em; }
.photo-frame { border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; max-width: 100%; }
.photo-frame canvas, .panel .visual canvas, .card-art { width: 100%; height: 100%; display: block; }

/* Capability panels */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 24px;
  overflow: hidden; display: flex; flex-direction: column;
}
.panel .visual { aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; padding: 6px; background: var(--bg); }
.tile-grid canvas { border-radius: 3px; }
.panel .copy { padding: 30px 34px 36px; }
.panel h3 { font-size: 28px; letter-spacing: -0.025em; margin: 14px 0 10px; }
.panel p { margin: 0; color: var(--muted); }

/* Togiva band */
.togiva { position: relative; overflow: hidden; }
.togiva::before {
  content: ""; position: absolute; width: 900px; height: 900px; right: -300px; top: -200px;
  background: radial-gradient(circle, color-mix(in srgb, var(--amber) 20%, transparent), transparent 60%);
  pointer-events: none;
}
.togiva-grid { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.app-id { display: flex; align-items: center; gap: 20px; margin: 28px 0 26px; }
.app-id img { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); }
.app-id h3 { font-size: clamp(40px, 5vw, 64px); letter-spacing: -0.04em; line-height: 1; }
.status {
  display: inline-block; margin-top: 10px; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 999px; color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 50%, transparent);
}
.togiva p.desc { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; margin: 0 0 32px; max-width: 30em; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.features li { display: flex; gap: 14px; color: var(--muted); }
.features li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 10px; border-radius: 50%; background: var(--teal); }

/* Phone mockup (synthetic content; the app's own colours, same in both themes) */
.phone-stage { display: grid; place-items: center; }
.phone {
  width: min(320px, 100%); aspect-ratio: 9 / 19; border-radius: 48px; padding: 12px;
  background: linear-gradient(160deg, #1d3a3e, #071518); box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.08);
  transform: rotate(3deg);
}
.screen {
  height: 100%; border-radius: 38px; overflow: hidden; background: #f6faf9; color: #0b2a2e;
  display: flex; flex-direction: column; font-family: var(--body);
}
.screen .top { padding: 44px 18px 14px; background: #0a4f54; color: #fff; }
.screen .top small { display: block; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }
.screen .top b { font: 700 18px/1.1 var(--display); }
.thread { flex: 1; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.4; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.msg.me { align-self: flex-end; background: #0f8a84; color: #fff; }
.msg .who { display: block; font-size: 10px; font-weight: 600; color: #0f8a84; margin-bottom: 2px; }
.photo {
  align-self: flex-start; width: 70%; aspect-ratio: 4 / 3; border-radius: 16px;
  background:
    radial-gradient(circle at 70% 35%, #ffd27a 0 14%, transparent 15%),
    linear-gradient(180deg, #8ed2e0 0%, #cfeef0 52%, #3f8a6a 53%, #2c6a50 100%);
}
.voice { align-self: flex-end; display: flex; align-items: center; gap: 3px; padding: 10px 12px; border-radius: 16px; background: #0f8a84; }
.voice i { width: 3px; border-radius: 2px; background: #fff; opacity: .9; }
.compose { margin: 0 12px 14px; padding: 11px 14px; border-radius: 999px; background: #fff; border: 1px solid #e3ecea; font-size: 12px; color: #5d7476; }

/* Contact: photographic card, always dark (sits on the image) */
#contact { border-bottom: 0; }
.contact-card {
  position: relative; overflow: hidden; border-radius: 28px; color: #f3f1ea;
  background: #0b0d10;
  padding: clamp(40px, 7vw, 96px) clamp(28px, 6vw, 80px);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end;
}
.card-art { position: absolute; inset: 0; }
.contact-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(8, 10, 12, .9) 0%, rgba(8, 10, 12, .62) 55%, rgba(8, 10, 12, .4) 100%);
}
.contact-card > div { position: relative; z-index: 2; }
.contact-card .label { color: rgba(243, 241, 234, .7); }
.contact-card h2 { font-size: clamp(44px, 6.4vw, 92px); line-height: .96; letter-spacing: -0.045em; margin-top: 18px; }
.contact-card p { color: rgba(243, 241, 234, .75); margin: 0 0 20px; }
button.reveal {
  font: inherit; cursor: pointer; color: inherit; background: none; border: 0; padding: 0;
  border-bottom: 1px solid var(--amber);
}
button.reveal.mail, a.mail {
  font: 600 clamp(22px, 2.6vw, 32px)/1.2 var(--display); letter-spacing: -0.02em; color: #fff;
  border-bottom: 2px solid #f6a623; text-decoration: none; padding-bottom: 4px;
}

/* Footer */
footer.site { padding-block: 48px 64px; color: var(--muted); font-size: 14px; }
footer.site .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
footer.site p { margin: 0 0 4px; }
footer.site .links { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
footer.site a { text-decoration: none; }
footer.site a:hover { color: var(--text); }
footer.site .legal-line { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }

/* Legal pages */
.legal { padding-block: 88px 120px; max-width: 760px; }
.legal h1 { font-size: clamp(40px, 5vw, 60px); letter-spacing: -0.04em; margin: 18px 0 12px; }
.legal h2 { font-size: 24px; margin: 44px 0 10px; letter-spacing: -0.02em; }
.legal p, .legal li { color: var(--muted); }

/* Load-in */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .rise:nth-child(2) { animation-delay: .08s; }
  .rise:nth-child(3) { animation-delay: .16s; }
  .rise:nth-child(4) { animation-delay: .24s; }
  .rise:nth-child(5) { animation-delay: .32s; }
  @keyframes rise { from { opacity: .001; transform: translateY(18px); } }
}
@media (prefers-reduced-motion: reduce) { body, .theme-toggle { transition: none; } }

@media (max-width: 900px) {
  .hero .wrap, .section-head, .about-body, .togiva-grid, .panels, .contact-card { grid-template-columns: 1fr; }
  .strata button { aspect-ratio: 16 / 11; }
  .section-head { gap: 18px; margin-bottom: 40px; }
  .togiva-grid { gap: 56px; }
  .contact-card::before { background: linear-gradient(180deg, rgba(8, 10, 12, .6), rgba(8, 10, 12, .9)); }
}
@media (max-width: 560px) {
  .nav-group, nav { gap: 16px; }
  nav a:first-child { display: none; }
  .meta { margin-top: 44px; }
  .panel .copy { padding: 26px 24px 30px; }
}
