/* ============================================================
   1. PALETTE: change these values to restyle the whole site
   ============================================================ */
:root{
  --bg:        #FBF9F5;
  --bg-soft:   #F4F1EA;
  --ink:       #1B1A17;
  --muted:     #6A655C;
  --line:      rgba(27,26,23,.13);
  --accent:    #B0562C;
  --accent-dim:rgba(176,86,44,.12);
  --radius:    14px;
  --measure:   62ch;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#131211; --bg-soft:#1B1917; --ink:#EEEAE3; --muted:#9C958A;
    --line:rgba(238,234,227,.15); --accent:#E08B5E; --accent-dim:rgba(224,139,94,.14);
  }
}
:root[data-theme="dark"]{
  --bg:#131211; --bg-soft:#1B1917; --ink:#EEEAE3; --muted:#9C958A;
  --line:rgba(238,234,227,.15); --accent:#E08B5E; --accent-dim:rgba(224,139,94,.14);
}

/* ============================================================
   2. BASE
   ============================================================ */
*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--sans); font-size:17px; line-height:1.65;
  -webkit-font-smoothing:antialiased; letter-spacing:-.005em;
  overflow-x:hidden;
}
/* faint paper grain */
body::before{
  content:""; position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.4;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode:multiply;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) body::before{ mix-blend-mode:screen; opacity:.16; }
}
:root[data-theme="dark"] body::before{ mix-blend-mode:screen; opacity:.16; }

a{ color:inherit; }
img{ max-width:100%; display:block; }
::selection{ background:var(--accent-dim); }

.wrap{ width:min(1080px, 90vw); margin-inline:auto; position:relative; z-index:1; }

h1,h2,h3{ font-family:var(--serif); font-weight:400; letter-spacing:-.02em; line-height:1.1; margin:0; }

/* small-caps section label */
.label{
  font-family:var(--sans); font-size:11.5px; font-weight:600; letter-spacing:.16em;
  text-transform:uppercase; color:var(--muted); margin:0 0 1.9rem;
  display:flex; align-items:center; gap:1rem;
}
.label::after{ content:""; flex:1; height:1px; background:var(--line); }

section{ padding:5.5rem 0; border-top:1px solid var(--line); }

/* ============================================================
   3. HEADER
   ============================================================ */
header{
  position:sticky; top:0; z-index:20;
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  background:color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom:1px solid transparent; transition:border-color .3s ease;
}
header.stuck{ border-bottom-color:var(--line); }
header .wrap{ display:flex; align-items:center; justify-content:space-between; height:64px; gap:1rem; }
.mark{ font-family:var(--serif); font-size:19px; text-decoration:none; letter-spacing:-.01em; white-space:nowrap; }
.mark span{ color:var(--accent); }
nav{ display:flex; align-items:center; gap:1.6rem; }
nav a{
  font-size:14px; color:var(--muted); text-decoration:none; padding:2px 0;
  border-bottom:1px solid transparent; transition:color .2s, border-color .2s;
}
nav a:hover{ color:var(--ink); border-bottom-color:var(--accent); }
.theme-btn{
  border:1px solid var(--line); background:transparent; color:var(--muted);
  width:32px; height:32px; border-radius:50%; cursor:pointer; display:grid; place-items:center;
  transition:color .2s, border-color .2s, transform .2s;
}
.theme-btn:hover{ color:var(--ink); border-color:var(--accent); transform:rotate(20deg); }
@media (max-width:640px){ nav{ gap:1.1rem; } nav a[data-hide-sm]{ display:none; } }

/* ============================================================
   4. HERO
   ============================================================ */
.hero{ padding:clamp(3.5rem,9vw,7rem) 0 4.5rem; border-top:none; }
.hero-grid{ display:grid; grid-template-columns:1fr 280px; gap:clamp(2rem,6vw,4.5rem); align-items:start; }
@media (max-width:820px){ .hero-grid{ grid-template-columns:1fr; } }

.eyebrow{
  font-size:12px; letter-spacing:.15em; text-transform:uppercase; color:var(--accent);
  font-weight:600; margin:0 0 1.4rem; display:flex; align-items:center; gap:.6rem;
}
.dot{ width:6px; height:6px; border-radius:50%; background:var(--accent); animation:pulse 3s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ opacity:1; transform:scale(1);} 50%{ opacity:.35; transform:scale(.8);} }

h1{ font-size:clamp(2.9rem, 8vw, 5.1rem); line-height:.98; margin:0 0 1.4rem; }
h1 em{ font-style:italic; color:var(--accent); }

.lede{ font-size:clamp(1.05rem,2.2vw,1.24rem); max-width:var(--measure); margin:0 0 1.3rem; line-height:1.55; }
.sub{ color:var(--muted); max-width:var(--measure); margin:0 0 2.2rem; font-size:16px; }

.meta{ display:flex; flex-wrap:wrap; gap:.5rem; }
.chip{
  font-size:12.5px; color:var(--muted); border:1px solid var(--line);
  padding:.34rem .8rem; border-radius:100px; background:var(--bg-soft);
}

/* photo */
.photo{
  position:relative; aspect-ratio:7/8; border-radius:var(--radius); overflow:hidden;
  background:var(--bg-soft); border:1px solid var(--line); margin:0;
}
.photo img{ width:100%; height:100%; object-fit:cover; object-position:50% 40%; }
.photo img.missing{ display:none; }
.photo img.missing + .photo-ph{ display:grid; }
.photo-ph{
  display:none; position:absolute; inset:0; place-content:center; text-align:center; gap:.5rem;
  color:var(--muted); font-size:12px; letter-spacing:.06em; padding:1rem; line-height:1.6;
  background-image:repeating-linear-gradient(45deg, var(--line) 0 1px, transparent 1px 11px);
}
.photo-ph strong{ display:block; font-family:var(--serif); font-size:15px; color:var(--ink); letter-spacing:0; }
@media (max-width:820px){ .photo{ max-width:250px; } }

/* ============================================================
   5. ABOUT
   ============================================================ */
.prose p{ max-width:var(--measure); margin:0 0 1.25rem; }
.prose p.dim{ color:var(--muted); }
.about-grid{ display:grid; grid-template-columns:1.35fr 1fr; gap:clamp(2rem,6vw,4.5rem); align-items:start; }
@media (max-width:820px){ .about-grid{ grid-template-columns:1fr; } .values{ padding-top:1rem; } }

.values{ display:grid; gap:1.6rem; padding-top:.35rem; }
.value{ padding-left:1.1rem; border-left:2px solid var(--accent-dim); transition:border-color .3s; }
.value:hover{ border-left-color:var(--accent); }
.value h3{ font-size:1.05rem; margin:0 0 .35rem; }
.value p{ margin:0; font-size:14.5px; color:var(--muted); line-height:1.6; }

/* ============================================================
   6. WORK
   ============================================================ */
.item{
  display:grid; grid-template-columns:120px 1fr; gap:1.5rem; align-items:baseline;
  padding:1.7rem 0; border-bottom:1px solid var(--line);
}
.item:first-of-type{ border-top:1px solid var(--line); }
.item .when{ font-size:12.5px; color:var(--muted); letter-spacing:.03em; padding-top:.35rem; }
.item h3{ font-size:1.32rem; margin:0 0 .4rem; }
.item p{ margin:0; color:var(--muted); font-size:14.8px; max-width:56ch; line-height:1.6; }
.item .tags{ display:block; margin-top:.6rem; font-size:12px; color:var(--muted); letter-spacing:.04em; opacity:.85; }

/* the "Live site / GitHub repo" line under each project */
.links-row{ display:flex; flex-wrap:wrap; gap:1.3rem; margin-top:.95rem; }
.links-row a{
  font-size:13px; font-weight:500; color:var(--ink); text-decoration:none;
  border-bottom:1px solid var(--line); padding-bottom:2px;
  transition:color .2s ease, border-color .2s ease;
}
.links-row a:hover{ color:var(--accent); border-bottom-color:var(--accent); }

@media (max-width:720px){
  .item{ grid-template-columns:1fr; gap:.45rem; }
  .item .when{ order:-1; padding-top:0; }
}

/* ============================================================
   7. TOOLKIT
   ============================================================ */
.kit{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:2.2rem; }
.kit h3{
  font-size:.78rem; font-family:var(--sans); font-weight:600; letter-spacing:.14em;
  text-transform:uppercase; color:var(--accent); margin:0 0 .7rem;
}
.kit p{ margin:0; color:var(--muted); font-size:15px; line-height:1.75; }

/* ============================================================
   8. CONTACT
   ============================================================ */
.contact{ background:var(--bg-soft); }
.contact h2{ font-size:clamp(2rem,5vw,3.1rem); margin:0 0 1rem; }
.contact .prose p{ margin-bottom:2.5rem; color:var(--muted); }
.links{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:1px;
  background:var(--line); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
}
.links a{ background:var(--bg); padding:1.4rem 1.5rem; text-decoration:none; display:block; transition:background .25s; }
.links a:hover{ background:var(--accent-dim); }
.links .k{ display:block; font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); margin-bottom:.4rem; }
.links .v{ display:block; font-family:var(--serif); font-size:1.02rem; word-break:break-word; }

footer{
  padding:2.5rem 0 0; margin-top:3.5rem; border-top:1px solid var(--line);
  font-size:13px; color:var(--muted); display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap;
}

/* ============================================================
   9. SCROLL REVEAL
   ============================================================ */
.reveal{ opacity:0; transform:translateY(18px); transition:opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
  html{ scroll-behavior:auto; }
  .dot{ animation:none; }
}
