/* Sofiene — portfolio. Tokens first, then layout, then components. */
:root {
  --ground: #F6F5F1;
  --ground-alt: #EEEDE6;
  --surface: #FFFFFF;
  --ink: #16162A;
  --ink-2: #4A4A60;
  --muted: #6E6E82;
  --line: #E1DFD6;
  --accent: #4B47C9;
  --accent-ink: #FFFFFF;
  --accent-soft: #E7E6FA;
  --lavender: #7B79B3;
  --ok: #1F8A5B;
  --shadow: 0 1px 2px rgba(22,22,42,.06), 0 8px 24px -12px rgba(22,22,42,.18);
  --radius: 18px;
  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E0E18; --ground-alt: #13131F; --surface: #191927; --ink: #EDECF6; --ink-2: #C1C0D3; --muted: #9A99AF;
    --line: #2A2A3C; --accent: #A3A0FF; --accent-ink: #12122A; --accent-soft: #24234A; --lavender: #5E5C93; --ok: #4CC38A;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0E0E18; --ground-alt: #13131F; --surface: #191927; --ink: #EDECF6; --ink-2: #C1C0D3; --muted: #9A99AF;
  --line: #2A2A3C; --accent: #A3A0FF; --accent-ink: #12122A; --accent-soft: #24234A; --lavender: #5E5C93; --ok: #4CC38A;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.65 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.9rem); letter-spacing: -.035em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.03em; }
h3 { font-size: 1.3rem; }
h1 em, h2 em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.hdr.scrolled { border-bottom-color: var(--line); }
.hdr-in { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { font: 700 1.45rem var(--f-display); text-decoration: none; letter-spacing: -.03em; }
.logo span { color: var(--accent); }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.nav a:hover { color: var(--ink); background: var(--ground-alt); }
.hdr-tools { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; justify-content: center; height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .85rem var(--f-body); text-decoration: none; cursor: pointer; }
.pill:hover { border-color: var(--accent); }
.icon-btn { padding: 0; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
.burger { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 999px; font: 700 1rem var(--f-body); text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn.ghost { border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.big { height: 58px; padding: 0 28px; font-size: 1.05rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 700 .78rem/1.3 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.lead { font-size: 1.16rem; color: var(--ink-2); max-width: 60ch; }

/* Hero */
.hero { padding: clamp(40px, 7vw, 96px) 0 40px; }
.hero-in { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-bottom: 32px; }
.hero-photo { position: relative; margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 28px; background: var(--lavender); box-shadow: var(--shadow); }
.hero-photo::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--accent); border-radius: 28px; z-index: -1; opacity: .35; }
.hero-photo figcaption { position: absolute; left: -14px; bottom: 28px; display: inline-flex; gap: 8px; align-items: center; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 700; font-size: .92rem; }
.hero-photo figcaption .ic { color: var(--accent); }
.svc-strip { list-style: none; padding: 0; margin: clamp(48px, 7vw, 80px) 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.svc-strip li { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .95rem; }
.svc-strip .ic { color: var(--accent); }

/* Sections */
.sec { padding: clamp(72px, 10vw, 128px) 0; }
.sec.alt { background: var(--ground-alt); }
.sec-head { margin-bottom: clamp(40px, 5vw, 64px); }
.sub { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-family: var(--f-body); margin: clamp(64px, 8vw, 96px) 0 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.kind { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tags { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
:root[data-theme="dark"] .tags li { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tags li { color: var(--ink); } }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Featured work */
.feats { display: grid; gap: clamp(56px, 8vw, 96px); }
.feat { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.feat.flip .shot { order: 2; }
.shot { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.shot img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; width: 100%; transition: transform .5s ease; }
.shot:hover img { transform: scale(1.025); }
.feat h3 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.feat-body > p:not(.kind) { color: var(--ink-2); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card p { color: var(--ink-2); }
.card-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-bottom: 20px; flex: none; }
.card-ic .ic { width: 24px; height: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.priv .note { font-size: .88rem; color: var(--muted); margin: 0; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.client a { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, transform .15s; }
.client a:hover { border-color: var(--accent); transform: translateY(-3px); }
.client-shot img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; width: 100%; border-bottom: 1px solid var(--line); }
.client-body { padding: 18px 20px 20px; }
.client h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 6px; }
.client h3 .ic { color: var(--accent); width: 1em; height: 1em; }
.client p:last-child { color: var(--ink-2); font-size: .95rem; margin: 0; }

/* Services */
.svcs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.svc { grid-column: span 2; display: flex; flex-direction: column; }
.svc:nth-child(4), .svc:nth-child(5) { grid-column: span 3; }
.checks { list-style: none; padding: 16px 0 0; margin: auto 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 26px; font-weight: 600; font-size: .95rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 8px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }

/* Process */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; counter-reset: s; }
.steps li { border-top: 2px solid var(--ink); padding-top: 20px; }
.steps .num { display: block; font: 400 2.6rem/1 var(--f-serif); font-style: italic; color: var(--accent); margin-bottom: 16px; }
.steps h3 { font-size: 1.15rem; }
.steps p { color: var(--ink-2); font-size: .97rem; }

/* About */
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.about p { color: var(--ink-2); font-size: 1.08rem; }
.stack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.stack h3 { margin-bottom: 20px; }
.stack-g p { font-weight: 700; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.stack-g:last-child .tags { margin-bottom: 0; }

/* Contact */
.contact { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(28px, 5vw, 64px); box-shadow: var(--shadow); }
.contact .lead { margin-bottom: 28px; }
.cinfo { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.cinfo li { display: flex; gap: 16px; align-items: center; }
.cinfo .card-ic { margin: 0; }
.cinfo p { margin: 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cinfo a, .cinfo span:not(.card-ic) { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.cinfo a:hover { color: var(--accent); }

/* Footer */
.ftr { border-top: 1px solid var(--line); padding: 28px 0; font-size: .92rem; color: var(--muted); }
.ftr-in { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.ftr p { margin: 0; }
.ftr-links { display: flex; gap: 18px; align-items: center; }
.ftr-links a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.ftr-links a:hover { color: var(--accent); }

/* 404 */
.nf { padding: 120px 0; min-height: 60vh; }

/* Reveal on scroll (only when JS is on and motion is OK) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .shot img, .btn, .client a { transition: none; }
}

/* Responsive */
@media (max-width: 1060px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
  .svcs { grid-template-columns: repeat(2, 1fr); }
  .svc, .svc:nth-child(4), .svc:nth-child(5) { grid-column: auto; }
  .svc:nth-child(5) { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .burger { display: inline-flex; }
  .nav { position: fixed; inset: 68px 0 auto 0; background: var(--ground); border-bottom: 1px solid var(--line); padding: 8px 16px 20px; display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: 14px 12px; font-size: 1.05rem; }
  .hdr-tools { margin-left: auto; }
  .hero-in, .feat, .about, .contact { grid-template-columns: 1fr; }
  .hero-photo { max-width: 340px; order: -1; }
  .feat.flip .shot { order: 0; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid4, .svcs, .steps { grid-template-columns: 1fr; }
  .hero-photo { max-width: 260px; }
  .hero-photo figcaption { left: auto; right: -8px; bottom: 16px; }
  .btn { width: 100%; justify-content: center; }
  .card, .stack { padding: 22px; }
}
