/* =========================================================
   Portfolio — main page styles
   ========================================================= */
:root {
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --ink: #111114;
  --ink-2: #45454D;
  --ink-3: #66666E;
  --line: #E1DFD8;
  --accent: #2F4BFF;
  --accent-hover: #1F38E0;
  --accent-soft: #E6E9FF;
  --live: #16A34A;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 28px;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -.025em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
html.has-dialog { overflow: hidden; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 999px;
  font: 600 16px/1 var(--font-body); text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14.5px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(47, 75, 255, .7); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: #CFCCC3; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--accent-soft); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 244, 240, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: var(--accent); color: #fff; font: 700 14px/1 var(--font-display); letter-spacing: .02em;
}
.main-nav { margin-left: auto; display: flex; gap: 4px; }
.main-nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.main-nav a:hover { color: var(--ink); background: rgba(17,17,20,.05); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 9vw, 112px); padding-bottom: clamp(56px, 8vw, 96px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(22,163,74,.15); flex: none; }
.hero h1 {
  margin-top: 28px; max-width: 15ch;
  font-size: clamp(44px, 8.2vw, 104px); font-weight: 700; letter-spacing: -.035em; line-height: 1;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { margin-top: 28px; max-width: 40em; font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); line-height: 1.55; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-index {
  list-style: none; margin: clamp(48px, 7vw, 80px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
}
.hero-index a { display: block; text-decoration: none; border-radius: var(--radius-m); padding: 8px 8px 14px; transition: background-color .2s; }
.hero-index a:hover { background: var(--surface); }
.hero-index img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  border-radius: 10px; box-shadow: 0 0 0 1px rgba(17,17,20,.08), 0 10px 24px -14px rgba(17,17,20,.4);
  transition: transform .35s var(--ease);
}
.hero-index a:hover img { transform: translateY(-4px); }
.hi-meta { display: flex; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.hi-num { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hi-name { display: block; margin-top: 2px; font: 600 17px/1.3 var(--font-display); letter-spacing: -.01em; }

/* ---------- Section heads ---------- */
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.kicker {
  display: inline-block; margin-bottom: 16px;
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.kicker-light { color: #B8C3FF; }
.section-head h2 { font-size: clamp(36px, 5.4vw, 64px); letter-spacing: -.035em; }
.section-intro { margin-top: 20px; font-size: 18.5px; color: var(--ink-2); max-width: 38em; }

.how-to { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.how-to li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; color: var(--ink-2); }
.how-to strong { color: var(--ink); font-weight: 600; }
.how-icon {
  flex: none; width: 26px; height: 26px; margin-top: 0; display: grid; place-items: center;
  border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700;
}

/* ---------- Work ---------- */
.work { padding: clamp(72px, 10vw, 128px) 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.projects { display: grid; gap: clamp(72px, 10vw, 136px); }

.project {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.project:nth-child(even) .project-visual { order: 2; }

.project-visual {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 11;
  padding: 0; border: 0; cursor: pointer; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-l);
  background:
    radial-gradient(120% 90% at 85% 100%, var(--panel-2) 0%, transparent 60%),
    var(--panel);
}
.project-visual::after { /* subtle inner border */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(17,17,20,.06);
}
.browser {
  position: absolute; left: 7%; top: 9%; width: 78%;
  display: block; overflow: hidden; border-radius: 12px; background: #fff;
  box-shadow: 0 40px 70px -30px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .5s var(--ease);
}
.browser-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #EEEDEA; border-bottom: 1px solid #E0DED8; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #D3D0C8; }
.browser-url {
  margin: 0 auto; transform: translateX(-14px);
  padding: 3px 14px; border-radius: 6px; background: #fff;
  font: 500 11px/1.4 var(--font-body); color: #77777E;
}
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.phone {
  position: absolute; right: 5%; bottom: 7%; width: 21%;
  display: block; padding: 5px; border-radius: 22px; background: #111114;
  box-shadow: 0 30px 50px -20px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.12) inset;
  transition: transform .5s var(--ease);
}
.phone img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 17px; }
.visual-hint {
  position: absolute; left: 50%; bottom: 20px; z-index: 2;
  padding: 10px 16px; border-radius: 999px; background: rgba(17,17,20,.86); color: #fff;
  font: 600 14px/1 var(--font-body); white-space: nowrap;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .25s, transform .25s var(--ease);
  pointer-events: none;
}
.project-visual:hover .browser, .project-visual:focus-visible .browser { transform: translateY(-8px); }
.project-visual:hover .phone, .project-visual:focus-visible .phone { transform: translateY(-14px) rotate(-1.5deg); }
.project-visual:hover .visual-hint, .project-visual:focus-visible .visual-hint { opacity: 1; transform: translate(-50%, 0); }
.project-visual:focus-visible { outline-offset: 4px; border-radius: var(--radius-l); }

.project-meta { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; color: var(--ink-3); }
.project-meta .num {
  display: inline-grid; place-items: center; min-width: 36px; height: 26px; padding: 0 8px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.project h3 { margin-top: 16px; font-size: clamp(34px, 4vw, 48px); letter-spacing: -.035em; }
.project-desc { margin-top: 14px; font-size: 18px; color: var(--ink-2); }
.highlights { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.highlights li { position: relative; padding-left: 30px; font-size: 16px; line-height: 1.45; }
.highlights li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%232F4BFF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.specs { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px 32px; }
.specs div { display: grid; gap: 6px; }
.specs dt { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.specs dd { margin: 0; font-size: 15px; font-weight: 500; }
.swatches { display: flex; gap: 6px; }
.swatches span { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(17,17,20,.14); }
.project-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Services ---------- */
.services { padding: clamp(72px, 10vw, 128px) 0; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.service {
  padding: 28px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.service:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -24px rgba(17,17,20,.3); }
.service-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); }
.service-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.service h3 { margin-top: 22px; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.service p { margin-top: 10px; font-size: 15.5px; color: var(--ink-2); line-height: 1.55; }

.included {
  margin-top: 16px; padding: clamp(28px, 4vw, 40px); border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 24px 48px; align-items: start;
}
.included h3 { font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
.included ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.included li { position: relative; padding-left: 30px; font-size: 16px; line-height: 1.45; }
.included li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* ---------- Process ---------- */
.process { padding: 0 0 clamp(72px, 10vw, 128px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.step { padding-top: 24px; border-top: 2px solid var(--ink); }
.step-num { font: 600 14px/1 var(--font-body); color: var(--accent); font-variant-numeric: tabular-nums; }
.step h3 { margin-top: 18px; font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
.step p { margin-top: 10px; font-size: 15.5px; color: var(--ink-2); max-width: 24em; }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(56px, 8vw, 96px); }
.contact-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(40px, 7vw, 88px); border-radius: var(--radius-l);
  background: var(--ink); color: #fff;
}
.contact-card::before {
  content: ""; position: absolute; z-index: -1; right: -20%; top: -60%; width: 80%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(47,75,255,.65), transparent 70%);
}
.contact-card h2 { font-size: clamp(38px, 6vw, 76px); letter-spacing: -.04em; max-width: 12ch; }
.contact-card > p:not(.kicker):not(.copy-status) { margin-top: 20px; max-width: 32em; font-size: 19px; color: #C9C9D1; }
.contact-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.copy-status { margin-top: 14px; min-height: 1.5em; font-size: 14.5px; color: #B8C3FF; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14.5px; color: var(--ink-3); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; }
.footer-inner p:first-child { color: var(--ink); font-weight: 500; }
.footer-inner a { margin-left: auto; text-decoration: none; font-weight: 500; color: var(--ink); }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   Device preview dialog
   ========================================================= */
.preview {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #1A1A1F; color: #fff;
  display: none; flex-direction: column;
}
.preview[open] { display: flex; }
.preview::backdrop { background: rgba(10,10,12,.7); }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 12px 16px; background: #111114; border-bottom: 1px solid rgba(255,255,255,.08);
}
.preview-nav { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 0; }
.preview-title { font: 600 17px/1.2 var(--font-display); letter-spacing: -.01em; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-actions { display: flex; align-items: center; gap: 8px; flex: 1 1 0; justify-content: flex-end; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border: 0; border-radius: 10px; background: rgba(255,255,255,.07); color: #fff; cursor: pointer;
  transition: background-color .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.15); }
.icon-btn svg, .device-switch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.device-switch { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.07); }
.device-switch button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 0; border-radius: 9px; background: transparent; color: #B4B4BE; cursor: pointer; font-size: 14px; font-weight: 500;
}
.device-switch button:hover { color: #fff; }
.device-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.preview :focus-visible { outline-color: #8EA0FF; }

.preview-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 20px; }
.device { position: relative; transition: width .35s var(--ease), height .35s var(--ease); }
.screen { position: relative; overflow: hidden; background: #fff; }
.screen iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #fff; }
.device.is-desktop .screen { border-radius: 10px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.device.is-tablet, .device.is-mobile { padding: 12px; background: #050507; box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset, 0 40px 80px -30px rgba(0,0,0,.9); }
.device.is-tablet { border-radius: 30px; }
.device.is-tablet .screen { border-radius: 18px; }
.device.is-mobile { border-radius: 46px; }
.device.is-mobile .screen { border-radius: 34px; }
.preview-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 10px 18px; border-radius: 999px; background: rgba(17,17,20,.9); font-size: 14px; color: #C9C9D1;
  pointer-events: none; transition: opacity .2s;
}
.preview-loading[hidden] { display: block; opacity: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .hero-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }
  .included { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .project:nth-child(even) .project-visual { order: 0; }
  .device-switch span { display: none; }
  .device-switch button { padding: 0 12px; }
}
@media (max-width: 720px) {
  .main-nav { display: none; }
  .header-inner { justify-content: space-between; }
  .hero-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-index li:last-child { grid-column: span 2; }
  .hero-index li:last-child img { aspect-ratio: 16 / 7; }
  .project-visual { aspect-ratio: 4 / 3.4; }
  .browser { left: 6%; top: 8%; width: 82%; }
  .browser-bar { height: 22px; padding: 0 9px; gap: 4px; }
  .browser-bar i { width: 6px; height: 6px; }
  .browser-url { display: none; }
  .phone { width: 27%; right: 5%; bottom: 6%; padding: 4px; border-radius: 16px; }
  .phone img { border-radius: 12px; }
  .visual-hint { opacity: 1; transform: translate(-50%, 0); bottom: 14px; font-size: 13px; padding: 8px 14px; }
  .included ul { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .footer-inner a { margin-left: 0; }
  .preview-bar { padding: 10px 12px; }
  .preview-nav { order: 1; flex-basis: 100%; justify-content: space-between; }
  .device-switch { order: 2; }
  .preview-actions { order: 3; }
  .preview-stage { padding: 12px; }
}
@media (max-width: 420px) {
  .hero-actions .btn, .project-actions .btn { flex: 1 1 100%; }
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
