/* ---------- Fonts (system stacks, no external fetch) ---------- */
:root{
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Color tokens: DARK is the default (bare :root) ---------- */
:root{
  --ink:        #08070c;
  --surface:    #121018;
  --surface-2:  #1a1722;
  --border:     #2a2536;
  --text:       #f3f1f7;
  --text-dim:   #a9a3b8;
  --violet:     #8b5cf6;
  --violet-strong: #a78bfa;
  --acid:       #c9ff52;
  --acid-ink:   #17130a;
  --rec:        #ff5c5c;
  --shadow:     0 20px 60px -20px rgb(139 92 246 / 0.35);
}

/* Explicit dark stamp wins over everything */
:root[data-theme="dark"]{
  --ink:        #08070c;
  --surface:    #121018;
  --surface-2:  #1a1722;
  --border:     #2a2536;
  --text:       #f3f1f7;
  --text-dim:   #a9a3b8;
  --violet:     #8b5cf6;
  --violet-strong: #a78bfa;
  --acid:       #c9ff52;
  --acid-ink:   #17130a;
  --rec:        #ff5c5c;
  --shadow:     0 20px 60px -20px rgb(139 92 246 / 0.35);
}

/* System light preference overrides the dark-first default, unless explicit dark chosen */
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){
    --ink:        #faf8fc;
    --surface:    #ffffff;
    --surface-2:  #f1edf7;
    --border:     #e1dbee;
    --text:       #17131f;
    --text-dim:   #5c5570;
    --violet:     #7c3aed;
    --violet-strong: #6d28d9;
    --acid:       #4f6b00;
    --acid-ink:   #f4ffd6;
    --rec:        #d3342f;
    --shadow:     0 20px 60px -25px rgb(124 58 237 / 0.25);
  }
}

/* Explicit light stamp wins in both directions */
:root[data-theme="light"]{
  --ink:        #faf8fc;
  --surface:    #ffffff;
  --surface-2:  #f1edf7;
  --border:     #e1dbee;
  --text:       #17131f;
  --text-dim:   #5c5570;
  --violet:     #7c3aed;
  --violet-strong: #6d28d9;
  --acid:       #4f6b00;
  --acid-ink:   #f4ffd6;
  --rec:        #d3342f;
  --shadow:     0 20px 60px -25px rgb(124 58 237 / 0.25);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior:auto; } }

body{
  margin:0;
  background:var(--ink);
  color:var(--text);
  font-family:var(--sans);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

img,svg{ display:block; max-width:100%; }
a{ color:inherit; }
::selection{ background:var(--violet); color:#fff; }

:focus-visible{
  outline:2px solid var(--acid);
  outline-offset:3px;
  border-radius:4px;
}

h1,h2,h3{ margin:0; text-wrap:balance; font-family:var(--sans); }
p{ margin:0; }

.wrap{
  max-width:1180px;
  margin-inline:auto;
  padding-inline:clamp(20px, 5vw, 56px);
}

.mono{
  font-family:var(--mono);
  letter-spacing:.06em;
}

.eyebrow{
  font-family:var(--mono);
  font-size:.72rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--text-dim);
  display:inline-flex;
  align-items:center;
  gap:.5em;
}

/* ---------- Chrome bar (video-call / window titlebar motif) ---------- */
.chrome{
  position:sticky;
  top:0;
  z-index:50;
  background:color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.chrome-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding-block:12px;
}
.dots{ display:flex; gap:6px; }
.dots span{
  width:9px; height:9px; border-radius:50%;
  background:var(--border);
}
.chrome-title{
  display:flex; align-items:center; gap:10px;
  font-family:var(--mono); font-size:.78rem; color:var(--text-dim);
}
.rec{
  display:inline-flex; align-items:center; gap:.5em;
  font-family:var(--mono); font-size:.72rem; letter-spacing:.1em;
  color:var(--rec);
}
.rec-dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--rec);
  animation:blink 1.6s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce){ .rec-dot{ animation:none; opacity:1; } }
@keyframes blink{ 0%,49%{opacity:1;} 50%,100%{opacity:.25;} }

nav{ display:flex; gap:clamp(14px,2.4vw,28px); }
nav a{
  font-family:var(--mono);
  font-size:.8rem;
  text-decoration:none;
  color:var(--text-dim);
  padding-block:4px;
  border-bottom:1px solid transparent;
  transition:color .15s ease, border-color .15s ease;
}
nav a:hover{ color:var(--text); border-color:var(--violet); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:.6em;
  font-family:var(--mono);
  font-size:.85rem;
  letter-spacing:.03em;
  text-decoration:none;
  padding:.85em 1.4em;
  border-radius:10px;
  border:1px solid transparent;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{
  background:var(--violet);
  color:#fff;
  box-shadow:var(--shadow);
}
.btn-primary:hover{ background:var(--violet-strong); }
.btn-ghost{
  background:transparent;
  border-color:var(--border);
  color:var(--text);
}
.btn-ghost:hover{ border-color:var(--acid); color:var(--acid); }
.btn-ghost .arrow{ transition:transform .15s ease; }
.btn-ghost:hover .arrow{ transform:translateX(3px); }

/* ---------- Hero ---------- */
.hero{
  padding-block:clamp(56px, 10vw, 108px) clamp(48px,8vw,88px);
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:clamp(32px,5vw,64px);
  align-items:center;
}
@media (max-width:860px){ .hero{ grid-template-columns:1fr; } }

.tag-row{ display:flex; flex-wrap:wrap; gap:8px; margin-block-start:20px; }
.chip{
  font-family:var(--mono);
  font-size:.72rem;
  letter-spacing:.06em;
  color:var(--text-dim);
  border:1px solid var(--border);
  background:var(--surface);
  padding:.45em .8em;
  border-radius:999px;
  white-space:nowrap;
}

.h1{
  font-size:clamp(2.5rem, 5.6vw, 4.6rem);
  font-weight:800;
  line-height:1.03;
  letter-spacing:-.02em;
  margin-block-start:18px;
}
.h1 .cursor{
  display:inline-block;
  width:.5ch;
  background:var(--acid);
  color:transparent;
  animation:caret 1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce){ .h1 .cursor{ animation:none; } }
@keyframes caret{ 0%,49%{opacity:1;} 50%,100%{opacity:0;} }

.lede{
  margin-block-start:20px;
  max-width:52ch;
  font-size:1.1rem;
  color:var(--text-dim);
}
.cta-row{ display:flex; gap:14px; flex-wrap:wrap; margin-block-start:32px; }

/* Viewfinder-framed photo placeholder */
.viewfinder{
  position:relative;
  aspect-ratio:4/5;
  border-radius:18px;
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--violet) 22%, var(--surface)) 0%, var(--surface) 60%);
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.viewfinder::before{
  content:"";
  position:absolute; inset:18px;
  border-radius:10px;
  border:1px dashed color-mix(in srgb, var(--text) 25%, transparent);
}
.vf-corner{
  position:absolute; width:22px; height:22px;
  border-color:var(--acid);
  border-style:solid;
  border-width:0;
}
.vf-tl{ top:14px; left:14px; border-top-width:2px; border-left-width:2px; border-top-left-radius:6px; }
.vf-tr{ top:14px; right:14px; border-top-width:2px; border-right-width:2px; border-top-right-radius:6px; }
.vf-bl{ bottom:14px; left:14px; border-bottom-width:2px; border-left-width:2px; border-bottom-left-radius:6px; }
.vf-br{ bottom:14px; right:14px; border-bottom-width:2px; border-right-width:2px; border-bottom-right-radius:6px; }
.vf-label{
  text-align:center;
  font-family:var(--mono);
  font-size:.78rem;
  color:var(--text-dim);
  padding:0 24px;
}
.vf-label strong{ display:block; color:var(--text); font-size:.95rem; margin-block-end:6px; }
.vf-tag{
  position:absolute; top:14px; left:50%; transform:translateX(-50%);
  font-family:var(--mono); font-size:.68rem; letter-spacing:.08em;
  color:var(--acid-ink); background:var(--acid);
  padding:.3em .7em; border-radius:999px;
}

/* ---------- Brands strip ---------- */
.brands{ padding-block:8px clamp(32px,5vw,48px); text-align:center; }
.brand-row{
  display:flex; flex-wrap:wrap;
  justify-content:center;
  gap:clamp(28px,4.5vw,48px);
  align-items:flex-start;
  margin-block-start:24px;
}
.brand-logo{
  width:120px; height:120px;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(155deg, #fbfaff, #f3f0fa);
  border:1px solid #e6e1f2;
  border-radius:20px;
  padding:20px;
  box-shadow:0 8px 24px -16px rgb(124 58 237 / 0.25);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.brand-logo:hover{
  transform:translateY(-4px);
  border-color:var(--violet);
  box-shadow:0 14px 28px -14px rgb(124 58 237 / 0.35);
}
.brand-logo img{ max-width:100%; max-height:100%; object-fit:contain; display:block; }
.brand-logo-zoom img{ transform:scale(1.8); }

/* ---------- Section shell ---------- */
section{ padding-block:clamp(56px,8vw,96px); }
.section-head{ max-width:640px; margin-block-end:clamp(32px,5vw,52px); }
.section-head h2{
  font-size:clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight:800;
  letter-spacing:-.01em;
  margin-block-start:14px;
}
.section-head p{ color:var(--text-dim); margin-block-start:12px; max-width:56ch; }
.divider{ border:none; border-top:1px solid var(--border); margin:0; }

/* reveal-on-scroll */
.reveal{ opacity:0; transform:translateY(14px); transition:opacity .5s ease, transform .5s ease; }
.reveal.in{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){ .reveal{ opacity:1; transform:none; transition:none; } }
html:not(.js) .reveal{ opacity:1; transform:none; }

/* ---------- About ---------- */
.about{
  display:grid;
  grid-template-columns:.85fr 1.15fr;
  gap:clamp(28px,5vw,64px);
  align-items:start;
}
@media (max-width:860px){ .about{ grid-template-columns:1fr; } }
.about-photo{
  position:relative;
  aspect-ratio:4/5;
  border-radius:16px;
  border:1px solid var(--border);
  background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--mono); font-size:.8rem; color:var(--text-dim);
  text-align:center; padding:20px;
}
.about-photo img{
  width:100%; height:100%; object-fit:cover; border-radius:inherit;
}
.bio p{ color:var(--text-dim); font-size:1.05rem; }
.bio p + p{ margin-block-start:16px; }
.pull{
  margin-block-start:24px;
  padding-inline-start:18px;
  border-left:2px solid var(--violet);
  font-family:var(--sans);
  font-weight:700;
  font-size:1.15rem;
  color:var(--text);
}

/* ---------- What I Create: app-window cards ---------- */
.grid-4{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}
@media (max-width:980px){ .grid-4{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .grid-4{ grid-template-columns:1fr; } }

.win{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.win:hover{ transform:translateY(-4px); border-color:var(--violet); box-shadow:var(--shadow); }
.win-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:var(--surface-2);
}
.win-body{ padding:18px 16px 20px; }
.win-body h3{ font-size:1.02rem; font-weight:700; }
.win-body p{ color:var(--text-dim); font-size:.92rem; margin-block-start:8px; }
.badge{
  font-family:var(--mono); font-size:.62rem; letter-spacing:.08em;
  color:var(--acid-ink); background:var(--acid);
  padding:.28em .6em; border-radius:5px;
}

/* ---------- Portfolio grid ---------- */
.grid-3{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}
@media (max-width:900px){ .grid-3{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .grid-3{ grid-template-columns:1fr; } }

.tile{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
}
.tile-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 11px;
  border-bottom:1px solid var(--border);
  background:var(--surface-2);
  font-family:var(--mono); font-size:.68rem; color:var(--text-dim);
}
.tile-bar span:last-child{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:75%;
}
.tile-stage{
  position:relative;
  aspect-ratio:16/10;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px;
  border:1px dashed var(--border);
  margin:10px;
  border-radius:8px;
  color:var(--text-dim);
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--violet) 6%, transparent) 0 12px, transparent 12px 24px);
}
.play{
  width:38px; height:38px; border-radius:50%;
  border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  color:var(--violet-strong);
}
.tile-stage span{ font-family:var(--mono); font-size:.72rem; }

.tile-video{
  aspect-ratio:16/10;
  background:var(--ink);
}
.tile-video video{ width:100%; height:100%; object-fit:cover; }

.work-empty{
  grid-column:1 / -1;
  text-align:center;
  color:var(--text-dim);
  font-family:var(--mono);
  font-size:.85rem;
  padding:32px 0;
}

/* ---------- Value cards ---------- */
.grid-3-value{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
}
@media (max-width:860px){ .grid-3-value{ grid-template-columns:1fr; } }
.value-card{
  padding:24px;
  border-radius:14px;
  background:var(--surface);
  border:1px solid var(--border);
}
.value-card .num{
  font-family:var(--mono); font-size:.75rem; color:var(--violet-strong);
}
.value-card h3{ margin-block-start:10px; font-size:1.1rem; font-weight:700; }
.value-card p{ margin-block-start:10px; color:var(--text-dim); font-size:.95rem; }

/* ---------- Contact ---------- */
.contact{
  border-radius:20px;
  background:linear-gradient(155deg, color-mix(in srgb, var(--violet) 16%, var(--surface)), var(--surface));
  border:1px solid var(--border);
  padding:clamp(32px,6vw,64px);
  text-align:center;
}
.contact h2{
  font-size:clamp(1.8rem,4vw,2.8rem);
  font-weight:800;
  line-height:1.15;
  letter-spacing:-.01em;
  max-width:26ch;
  margin-inline:auto;
}
.contact .lede{ margin-inline:auto; text-align:center; }
.contact .cta-row{ justify-content:center; }
.email-line{
  margin-block-start:18px;
  font-family:var(--mono);
  color:var(--text-dim);
  font-size:.95rem;
}
.social-row{
  display:flex; gap:10px; justify-content:center; flex-wrap:wrap;
  margin-block-start:28px;
}
.social-chip{
  font-family:var(--mono); font-size:.72rem; color:var(--text-dim);
  border:1px dashed var(--border);
  padding:.5em .9em; border-radius:999px;
}
a.social-chip{
  text-decoration:none;
  border-style:solid;
  transition:color .15s ease, border-color .15s ease;
}
a.social-chip:hover{ color:var(--acid); border-color:var(--acid); }

.form-divider{
  display:flex; align-items:center; gap:14px;
  max-width:520px; margin:36px auto 0;
  font-family:var(--mono); font-size:.7rem; letter-spacing:.06em;
  color:var(--text-dim); text-transform:uppercase;
}
.form-divider::before, .form-divider::after{
  content:""; flex:1; height:1px; background:var(--border);
}

.contact-form{
  display:flex; flex-direction:column; gap:16px;
  max-width:520px; margin:24px auto 0;
  text-align:left;
}
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{
  font-family:var(--mono); font-size:.7rem; letter-spacing:.08em;
  text-transform:uppercase; color:var(--text-dim);
}
.field input, .field textarea{
  font-family:var(--sans); font-size:.95rem; line-height:1.5;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:10px;
  padding:.75em .9em;
  resize:vertical;
  transition:border-color .15s ease;
}
.field input::placeholder, .field textarea::placeholder{ color:var(--text-dim); opacity:.75; }
.field input:focus, .field textarea:focus{
  outline:2px solid var(--acid); outline-offset:1px;
  border-color:var(--violet);
}
.form-submit{
  align-self:center;
  border:none;
  margin-block-start:4px;
}
.form-submit:disabled{ opacity:.6; cursor:default; }
.form-note{
  text-align:center;
  font-size:.78rem;
  color:var(--text-dim);
}
.form-error{
  font-size:.8rem;
  color:var(--rec);
  margin:0;
}
.form-success{
  flex-direction:column; align-items:center; gap:12px;
  max-width:480px; margin:24px auto 0;
  padding:28px 24px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  text-align:center;
}
.form-success[hidden]{ display:none; }
.form-success:not([hidden]){ display:flex; }
.form-success-check{
  width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:var(--acid); color:var(--acid-ink);
  font-size:1.1rem; font-weight:700;
}
.form-success p{ color:var(--text-dim); font-size:.95rem; }

footer{ padding-block:32px 48px; }
.foot-inner{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:14px;
  font-family:var(--mono); font-size:.75rem; color:var(--text-dim);
}
.foot-inner nav{ gap:18px; }
.foot-inner nav a{ font-size:.75rem; }

/* ---------- Admin page (admin.html) ---------- */
.admin-wrap{ max-width:520px; margin:80px auto; padding:0 24px; }
.admin-panel{
  background:var(--surface); border:1px solid var(--border);
  border-radius:14px; padding:36px;
}
.admin-panel h1{ font-size:1.5rem; font-weight:800; margin:0 0 24px; }
.admin-panel .field input[type="file"]{
  background:transparent; border:1px dashed var(--border);
  padding:14px; border-radius:8px; width:100%; font-size:13px; color:var(--text);
}
.form__status{ font-size:.85rem; }
.form__status--ok{ color:var(--acid); }
.form__status--err{ color:var(--rec); }
