/* ============ Tokens ============ */
:root {
  --bg: #ffffff;
  --gray: #f5f5f7;
  --surface: #f5f5f7;
  --surface-2: #e8e8ed;
  --hover: #dcdce1;
  --line: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --dim: #86868b;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link: #0066cc;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --max: 1180px;
  --nav-h: 48px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 72px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(var(--max), 100% - 44px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: #fff; padding: 8px 14px; border-radius: 980px; z-index: 100; }
.skip:focus { left: 12px; }
body.locked { overflow: hidden; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 980px; border: 0;
  font-size: 17px; font-weight: 400; letter-spacing: -0.022em;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-ghost { background: transparent; color: var(--link); border: 1px solid var(--link); }
.btn-ghost:hover { background: var(--link); color: #fff; }
.btn-light { background: rgba(255,255,255,.92); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.12); backdrop-filter: blur(12px); }
.btn-light:hover { background: #fff; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; letter-spacing: -0.016em; }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 30; height: var(--nav-h);
  background: rgba(255,255,255,.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { color: var(--text); font-weight: 600; font-size: 17px; }
.logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 32px; align-items: center; list-style: none; margin: 0; padding: 0; font-size: 12px; letter-spacing: -0.01em; }
.nav-links a { color: rgba(0,0,0,.8); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .btn { color: #fff; min-height: 28px; padding: 0 12px; font-size: 12px; }

/* ============ Hero ============ */
.hero {
  min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 0; text-align: center;
}
.status {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; margin-bottom: 28px;
  border-radius: 980px; background: var(--surface-2); color: var(--muted); font-size: 14px;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,.18); }
.hero h1 {
  margin: 0 auto; max-width: 15ch; text-wrap: balance;
  font-size: clamp(48px, 7vw, 80px); line-height: 1.05; font-weight: 600; letter-spacing: -0.015em;
}
.hero .role { margin: 16px 0 0; font-size: clamp(21px, 2.4vw, 28px); line-height: 1.14; font-weight: 600; color: var(--text); letter-spacing: 0.007em; }
.hero .intro { margin: 18px auto 0; max-width: 34em; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.38; letter-spacing: 0.011em; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }

/* ============ About ============ */
.about { padding: 0 0 96px; }
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.about .panel.skills-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 40px; }
@media (max-width: 1100px) and (min-width: 761px) { .about .panel.skills-panel { grid-template-columns: 1fr 1fr; } }
.about .panel.skills-panel .tools-label { margin-top: 0; }
@media (max-width: 760px) { .about .panel.skills-panel { grid-template-columns: 1fr; } .about .panel.skills-panel > div + div { margin-top: 20px; } }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: clamp(28px, 4vw, 48px); }
.about h2 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: 0; }
.about p { color: var(--muted); margin: 18px 0 0; max-width: 36em; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.facts strong { display: block; font-size: 28px; line-height: 1.14; font-weight: 600; letter-spacing: 0.007em; }
.facts span { color: var(--muted); font-size: 17px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 0; list-style: none; }
.tools .chip { background: #fff; color: var(--text); }
.tools-label { margin: 32px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: -0.016em; }
.about .panel:first-child { display: flex; flex-direction: column; justify-content: center; }

/* Chips used everywhere */
.chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 980px;
  background: var(--surface-2); color: var(--muted); font-size: 14px; border: 0; white-space: nowrap;
}

/* ============ Work ============ */
.work { padding: 100px 0 120px; background: var(--gray); }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-size: clamp(32px, 4.4vw, 48px); font-weight: 600; letter-spacing: -0.003em; line-height: 1.08; }
.section-head p { margin: 14px auto 0; color: var(--muted); font-size: 21px; line-height: 1.38; letter-spacing: 0.011em; max-width: 32em; }

.filter-bar {
  position: sticky; top: var(--nav-h); z-index: 20; padding: 14px 0; margin-bottom: 28px;
  background: linear-gradient(var(--gray) 70%, rgba(245,245,247,0));
}
.filters {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0; padding: 0; list-style: none;
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.filters.shown { opacity: 1; transform: none; }
.filters li { flex: none; }
.filters button {
  white-space: nowrap; min-height: 40px; padding: 0 18px; border-radius: 980px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 14px; font-weight: 400; letter-spacing: -0.016em;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.filters button:hover { border-color: var(--dim); }
.filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.filters .count { color: var(--dim); font-weight: 400; margin-left: 6px; font-size: 13px; }
.filters button[aria-pressed="true"] .count { color: #a1a1a6; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fff; border-radius: var(--r-md); box-shadow: 2px 4px 12px rgba(0,0,0,.08); transition: box-shadow .3s var(--ease), transform .3s var(--ease); overflow: hidden; display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.03); }
.card:hover { box-shadow: 2px 4px 16px rgba(0,0,0,.16); transform: scale(1.01); }
.card-media.contain img { object-fit: contain; object-position: center; padding: 18px; }
.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(0,0,0,.25); opacity: 0; transition: opacity .25s var(--ease);
}
.card:hover .overlay, .card:focus-within .overlay { opacity: 1; }
.overlay .icon-only { display: none; }
.card-body { padding: 24px 28px 30px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.card h3 { margin: 0; font-size: 24px; line-height: 1.17; font-weight: 600; letter-spacing: 0.009em; }
.card p { margin: 4px 0 0; color: var(--muted); font-size: 17px; }
.card .result { color: var(--text); font-size: 14px; margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--link); }

/* Touch: no hover, so show compact icon buttons on the image */
@media (hover: none) {
  .overlay { opacity: 1; background: none; align-items: flex-end; justify-content: flex-end; padding: 12px; gap: 8px; }
  .overlay .btn { width: 44px; height: 44px; min-height: 44px; padding: 0; background: rgba(255,255,255,.92); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.15); }
  .overlay .label { display: none; }
  .overlay .icon-only { display: block; }
  .card:hover .card-media img { transform: none; }
}
.icon { width: 20px; height: 20px; flex: none; }

/* Placeholder for project images not added yet */
.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 20px;
  color: var(--dim); font-size: 13px;
  background: repeating-linear-gradient(135deg, #f5f5f7 0 14px, #ededf0 14px 28px);
}
.placeholder b { display: block; color: var(--muted); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 6px; }

.see-all { display: grid; place-items: center; text-align: center; padding: 40px 28px; background: #fff; box-shadow: 2px 4px 12px rgba(0,0,0,.08); border: 0; border-radius: var(--r-md); min-height: 320px; }
.see-all strong { display: block; font-size: 24px; font-weight: 600; letter-spacing: 0.009em; }
.see-all span { color: var(--link); font-size: 17px; margin-top: 8px; display: block; }
.see-all:hover span { text-decoration: underline; }

/* ============ Capabilities ============ */
.caps { padding: 120px 0; }
.caps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.caps-grid .panel { padding: 32px; border-radius: var(--r-md); }
.caps-grid h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.19; font-weight: 600; letter-spacing: 0.011em; }
.caps-grid p { margin: 0; color: var(--muted); font-size: 17px; }

/* ============ Contact ============ */
.contact { padding: 120px 0; text-align: center; background: var(--gray); }
.contact h2 { margin: 0; font-size: clamp(48px, 7vw, 80px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.05; }
.contact p { color: var(--muted); font-size: 21px; line-height: 1.38; letter-spacing: 0.011em; margin: 18px auto 0; max-width: 30em; }
.contact .chip { background: #fff; border: 1px solid var(--line); }
.pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 26px 0 34px; padding: 0; list-style: none; }
.footer { padding: 20px 0 32px; color: var(--muted); font-size: 12px; background: var(--gray); border-top: 1px solid var(--line); }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: rgba(0,0,0,.8); }
.footer ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }

/* ============ Reveal on scroll ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============ Modal shell ============ */
.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: fade .25s var(--ease); }
.sheet {
  position: absolute; inset: 24px; margin: auto; max-width: 1180px;
  background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25); border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column; animation: rise .35s var(--ease);
}
.sheet.narrow { max-width: 560px; height: fit-content; max-height: calc(100% - 48px); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head .title { flex: 1; min-width: 0; }
.head-extra { display: flex; align-items: center; gap: 12px; order: 1; }
.sheet-head .round[data-close] { order: 2; }
.sheet-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: 0.012em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .sub { color: var(--muted); font-size: 13px; }
.round {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text);
  display: inline-grid; place-items: center; flex: none;
}
.round:hover { background: var(--hover); }
.round:disabled { opacity: .35; cursor: default; }
.counter { color: var(--muted); font-size: 13px; min-width: 40px; text-align: center; }
.sheet-body { flex: 1; overflow: auto; overscroll-behavior: contain; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.985); } }

/* Segmented control (email view toggle) */
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 980px; padding: 3px; }
.segmented button { border: 0; background: none; color: var(--muted); padding: 6px 16px; border-radius: 980px; font-size: 14px; font-weight: 500; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* ============ View project: device frames ============ */
.viewer { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 20px 24px; height: 100%; }
.browser {
  width: 100%; max-width: 1040px; flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.15), 0 0 0 1px var(--line);
}
.browser-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: #ececef; border-bottom: 1px solid var(--line); flex: none; }
.dots { display: flex; gap: 7px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.url { flex: 1; max-width: 460px; margin: 0 auto; background: #fff; color: var(--muted); font-size: 13px; text-align: center; padding: 5px 12px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen { flex: 1; overflow: auto; background: #fff; overscroll-behavior: contain; }
.screen img { width: 100%; height: auto; }
.screen .placeholder { min-height: 100%; }
.phone {
  width: 340px; max-width: 100%; flex: 1; min-height: 0; max-height: 720px;
  border-radius: 48px; padding: 12px; background: #1d1d1f; box-shadow: 0 20px 50px rgba(0,0,0,.25), inset 0 0 0 2px #3a3a3c;
  display: flex; flex-direction: column;
}
.phone .screen { border-radius: 38px; }
.viewer-nav { display: flex; align-items: center; gap: 16px; flex: none; }
.pager { display: flex; gap: 8px; }
.pager button { width: 24px; height: 24px; padding: 8px; background-clip: content-box !important; border-radius: 50%; border: 0; background: #c7c7cc; }
.pager button[aria-current="true"] { background: var(--text); }
.caption { color: var(--muted); font-size: 14px; text-align: center; margin: 0; flex: none; }

/* ============ View process: one scrolling story ============ */
.story-nav { display: flex; gap: 6px; padding: 10px 20px; overflow-x: auto; border-bottom: 1px solid var(--line); flex: none; scrollbar-width: none; }
.story-nav::-webkit-scrollbar { display: none; }
.story-nav a { color: var(--muted); font-size: 14px; padding: 6px 14px; border-radius: 980px; white-space: nowrap; }
.story-nav a:hover { color: var(--text); text-decoration: none; }
.story-nav a[aria-current="true"] { background: var(--surface-2); color: var(--text); }
.story { padding: 0 clamp(20px, 6vw, 88px) 80px; }
.story section { padding: 64px 0 8px; max-width: 880px; margin: 0 auto; }
.story h3 { text-wrap: balance; margin: 0; font-size: clamp(28px, 4vw, 48px); line-height: 1.08; font-weight: 600; letter-spacing: -0.003em; max-width: 20ch; }
.story .lead { color: var(--muted); font-size: 21px; line-height: 1.38; letter-spacing: 0.011em; margin: 18px 0 0; max-width: 38em; }
.story ul.points { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.story ul.points li { padding-left: 22px; position: relative; color: var(--text); }
.story ul.points li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--link); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 30px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 22px; }
.stat strong { display: block; font-size: 40px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.1; }
.stat span { display: block; color: var(--muted); font-size: 14px; margin-top: 10px; }
.figure { margin: 32px 0 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.figure img { width: 100%; }
.figure .placeholder { aspect-ratio: 16 / 9; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 28px; }
.cardlet { background: var(--surface); border-radius: var(--r-md); padding: 22px; }
.cardlet strong { display: block; font-size: 19px; font-weight: 600; letter-spacing: 0.012em; line-height: 1.2; }
.cardlet span { display: block; color: var(--muted); font-size: 15px; margin-top: 8px; line-height: 1.45; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 32px; }
.gallery figure { margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface); display: grid; place-items: center; }
.gallery figure img { width: 100%; }
.gallery.phones { grid-template-columns: repeat(auto-fit, minmax(150px, 220px)); justify-content: center; }
.gallery.phones figure { border-radius: 28px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.story .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding: 0; list-style: none; }

/* ============ Email preview ============ */
.email-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100%; min-height: 0; }
.email-stage { display: flex; flex-direction: column; align-items: center; padding: 28px 20px; min-height: 0; background: var(--gray); }
.email-stage .browser {  max-width: 720px; }
.email-stage .phone { max-height: none; }
.email-notes { padding: 28px; overflow: auto; border-left: 1px solid var(--line); }
.email-notes .type { color: var(--muted); font-size: 14px; }
.email-notes h3 { margin: 6px 0 0; font-size: 24px; font-weight: 600; letter-spacing: 0.009em; line-height: 1.17; }
.email-notes .goal { color: var(--muted); margin: 12px 0 0; }
.trick { margin: 22px 0 0; padding: 18px; border-radius: var(--r-md); background: var(--surface); }
.trick b { display: block; font-size: 14px; color: var(--link); font-weight: 600; margin-bottom: 4px; }
.email-notes h4 { margin: 26px 0 10px; font-size: 15px; font-weight: 600; color: var(--muted); }
.email-notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.email-notes li strong { display: block; font-weight: 600; font-size: 17px; }
.email-notes li span { color: var(--muted); font-size: 17px; }

/* ============ Graphics viewer ============ */
.gallery-stage { flex: 1; min-height: 0; width: 100%; position: relative; }
.gallery-stage img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; border-radius: var(--r-sm); }
.gallery-stage .placeholder { position: absolute; inset: 0; }

/* ============ Contact modal ============ */
.contact-body { padding: 28px; }
.contact-body h3 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: 0.007em; line-height: 1.14; }
.contact-body > p { color: var(--muted); margin: 8px 0 22px; }
.choice { display: block; width: 100%; text-align: left; padding: 18px 20px; border-radius: var(--r-md); border: 0; background: var(--surface); margin-bottom: 12px; }
.choice:hover { background: var(--surface-2); }
.choice strong { display: block; font-size: 17px; font-weight: 600; }
.choice span { color: var(--muted); font-size: 15px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px; outline: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--link); }
.hp { position: absolute; left: -9999px; }
.back { background: none; border: 0; color: var(--link); padding: 0; margin-bottom: 16px; font-size: 15px; }
.cal { width: 100%; height: 560px; border: 0; border-radius: var(--r-md); background: #fff; }
.form-msg { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .grid, .caps-grid { grid-template-columns: repeat(2, 1fr); }
  .email-layout { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .email-stage { height: 72vh; }
  .email-notes { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .sheet-body.email-scroll { overflow: auto; }
}
@media (max-width: 760px) {
  .nav-links li:not(:last-child) { display: none; }
  .about-grid, .grid, .caps-grid { grid-template-columns: 1fr; }
  .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 0 22px; margin: 0 -22px; }
  .filters::-webkit-scrollbar { display: none; }
  .sheet { inset: 0; border-radius: 0; }
  .sheet.narrow { inset: auto 0 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92%; }
  .viewer { padding: 18px 12px; }
  .phone { width: 300px; border-radius: 42px; }
  /* Pop-up header: title and close on top, controls on their own row */
  .sheet-head { flex-wrap: wrap; row-gap: 12px; padding: 14px 16px; }
  .head-extra { order: 3; width: 100%; justify-content: space-between; }
  .head-extra .segmented { margin-right: auto; }
  .head-extra:has(> .btn:only-child) { justify-content: flex-start; }
  .story { padding: 0 20px 64px; }
  .story section { padding-top: 48px; }
  .story .lead { font-size: 17px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; }
  .stat strong { font-size: 24px; white-space: nowrap; }
  .stat span { font-size: 13px; }
  .email-stage { height: 64vh; padding: 16px 12px; }
  .email-notes { padding: 22px 20px 40px; }
  .email-notes h3 { font-size: 22px; }
  .contact-body { padding: 22px 20px 32px; }
  .hero-ctas .btn { min-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .filters { opacity: 1; transform: none; }
}

/* ============ Compare viewer (before / redesign + notes) ============ */
.shot { position: relative; }
.shot img { width: 100%; height: auto; }
.pin {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 980px; border: 2px solid #fff;
  background: #ff3b30; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.35);
  transition: transform .2s var(--ease);
}
.pin.after { background: #34c759; }
.pin:hover { transform: translate(-50%, -50%) scale(1.12); }
.shot.no-notes .pin, .shot.no-notes .note-pop { display: none; }
.note-pop {
  position: absolute; z-index: 3; width: min(300px, 80%); padding: 14px 16px; border-radius: var(--r-sm);
  background: #fff; color: var(--text); font-size: 14px; line-height: 1.45; box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.note-pop b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text); font-size: 14px; padding: 4px 2px; }
.toggle .knob { width: 36px; height: 22px; border-radius: 980px; background: #d2d2d7; position: relative; transition: background .2s var(--ease); }
.toggle .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.toggle[aria-pressed="true"] .knob { background: #34c759; }
.toggle[aria-pressed="true"] .knob::after { transform: translateX(14px); }
@media (max-width: 760px) { .pin { min-width: 26px; height: 26px; font-size: 11px; } }
.btn { white-space: nowrap; }
@media (max-width: 760px) {
  .note-pop { left: 8px !important; right: 8px !important; width: auto; }
  .head-extra { flex-wrap: wrap; gap: 10px; }
}

/* ============ Viewer: fixed device sizes ============ */
.sheet { inset: 12px; max-width: 1480px; }
.sheet.narrow { max-width: 560px; }
.sheet-head { padding: 12px 16px 12px 20px; }
.sheet-body:has(> .viewer) { overflow-y: auto !important; }
.viewer { height: auto; min-height: 100%; padding: 20px 16px; gap: 14px; justify-content: center; }
/* Desktop: always a 1440 × 900 viewport, scaled to the sheet width */
.viewer .browser, .email-stage .browser {
  flex: none; width: min(100%, 1200px); max-width: none; height: auto; min-height: 0;

}
.viewer .browser .screen { flex: none; aspect-ratio: 1440 / 900; height: auto; }
/* Mobile: always an iPhone, 360 × 780, never squeezed */
.viewer .phone, .email-stage .phone {
  flex: none; width: 360px; height: 780px; max-width: none; max-height: none; min-height: 0; aspect-ratio: auto;
}
.caption { font-size: 13px; }
@media (max-width: 760px) {
  .sheet { inset: 0; }
  .viewer .phone, .email-stage .phone { width: 320px; height: 693px; }
}

/* Pop-up states shown on top of the dimmed page */
.browser, .phone { position: relative; }
.popup-layer { position: absolute; inset: 0; top: var(--bar, 0); background: rgba(29,29,31,.45); display: flex; align-items: flex-end; justify-content: center; overflow: auto; }
.browser .popup-layer { top: 41px; align-items: center; padding: 3%; }
.phone .popup-layer { inset: 12px; border-radius: 38px; }
.popup-card { width: 100%; }
.popup-card.center { width: 46%; min-width: 280px; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.popup-card img, .popup-card .ph { display: block; width: 100%; }
/* Arrows stay reachable even when the frame is taller than the screen */
.viewer .viewer-nav { position: sticky; bottom: 12px; z-index: 3; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }

/* ============ Project viewer: full screen, one scroll only ============ */
.sheet.sheet-full { inset: 0; max-width: none; border-radius: 0; background: var(--gray); box-shadow: none; }
.sheet-full .sheet-head { background: rgba(245,245,247,.85); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 0; }
.sheet-full .sheet-body { overflow: hidden !important; }
.sheet-full .viewer { height: 100%; min-height: 0; padding: 8px 24px 20px; gap: 14px; justify-content: flex-start; }
.sheet-full .stage { flex: 1; min-height: 0; width: 100%; container-type: size; display: flex; align-items: center; justify-content: center; }
/* Desktop frame: 1440 × 900 screen + 41px bar, scaled evenly to fit */
.sheet-full .browser {
  width: min(100cqw, 1280px, (100cqh - 41px) * 1.6); height: auto; max-width: none; flex: none; min-height: 0;
  box-shadow: 0 30px 80px rgba(0,0,0,.12);
}
.sheet-full .browser .screen { aspect-ratio: 1440 / 900; flex: none; height: auto; scrollbar-width: thin; }
/* Phone: iPhone proportions, scaled evenly to fit */
.sheet-full .phone {
  height: min(100cqh, 820px); width: auto; aspect-ratio: 390 / 844; max-width: 100cqw; max-height: none; flex: none; min-height: 0;
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
}
.sheet-full .phone .screen { scrollbar-width: none; }
.sheet-full .phone .screen::-webkit-scrollbar { display: none; }
.sheet-full .viewer .viewer-nav { position: static; background: #fff; }
.sheet-full .caption { margin: 0; }
@media (max-width: 760px) {
  .sheet-full .viewer { padding: 8px 12px 16px; }
}

/* Light glass on the full-screen viewers */
.sheet.sheet-full { background: rgba(245,245,247,.9); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); }
.sheet-full .sheet-head { background: rgba(255,255,255,.6); border-bottom: 1px solid rgba(0,0,0,.06); }

/* Email viewer: notes stay fixed, only the email scrolls */
.sheet-full .sheet-body.email-scroll { overflow: hidden; }
.sheet-full .email-layout { height: 100%; grid-template-columns: minmax(0, 1fr) 380px; }
.sheet-full .email-stage { background: transparent; padding: 16px 24px 24px; min-height: 0; height: 100%; }
.sheet-full .email-stage .stage { height: 100%; }
.sheet-full .email-stage .browser { width: min(100cqw, 900px); height: 100cqh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.12); }
.sheet-full .email-stage .browser .screen { flex: 1; min-height: 0; aspect-ratio: auto; height: auto; scrollbar-width: thin; }
.sheet-full .email-stage .phone { height: min(100cqh, 820px); width: auto; aspect-ratio: 390 / 844; max-width: 100cqw; flex: none; box-shadow: 0 30px 80px rgba(0,0,0,.18); }
.sheet-full .email-stage .phone .screen { scrollbar-width: none; }
.sheet-full .email-stage .phone .screen::-webkit-scrollbar { display: none; }
.sheet-full .email-notes { background: rgba(255,255,255,.7); border-left: 1px solid rgba(0,0,0,.06); overflow: auto; height: 100%; }
@media (max-width: 1000px) {
  .sheet-full .sheet-body.email-scroll { overflow: auto; }
  .sheet-full .email-layout { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .sheet-full .email-stage { height: 76vh; height: 76svh; padding: 12px; }
  .sheet-full .email-notes { height: auto; overflow: visible; border-left: 0; border-top: 1px solid rgba(0,0,0,.06); }
}

/* Zoom */
.screen img { transition: none; }
.screen:has(img) { cursor: zoom-in; }
.screen.zoomed { cursor: zoom-out; overflow: auto; }
.screen.zoomed img { width: 150%; max-width: none; }
.zoom-btn {
  position: absolute; right: 14px; bottom: 14px; z-index: 4; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,.75); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.zoom-btn:hover { background: #fff; }
.phone .zoom-btn { right: 22px; bottom: 22px; }
@media (hover: none) { .zoom-btn { display: none; } .screen:has(img) { cursor: auto; } }

/* No scrollbars inside device frames */
.browser .screen, .phone .screen { scrollbar-width: none !important; }
.browser .screen::-webkit-scrollbar, .phone .screen::-webkit-scrollbar { display: none; }
/* Scroll cue: soft fade + small pill that hides after the first scroll */
.scroll-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none; z-index: 2;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.75));
  transition: opacity .3s;
}
.phone .scroll-fade { left: 12px; right: 12px; bottom: 12px; border-radius: 0 0 38px 38px; }
.scroll-pill {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: #fff; background: rgba(29,29,31,.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: opacity .3s;
}
.phone .scroll-pill { bottom: 30px; }
.scroll-pill svg { width: 14px; height: 14px; }
.scroll-fade.off, .scroll-pill.off { opacity: 0; }

/* ============ Glass viewer (dark, blurred backdrop; device floats) ============ */
.backdrop { background: rgba(12,12,14,.68); backdrop-filter: saturate(140%) blur(28px); -webkit-backdrop-filter: saturate(140%) blur(28px); }
.sheet.sheet-full { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.sheet-full .sheet-head { background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff; }
.sheet-full .sheet-head h2 { color: #fff; }
.sheet-full .sheet-head .sub { color: rgba(255,255,255,.6); }
.sheet-full .round { background: rgba(255,255,255,.12); color: #fff; }
.sheet-full .round:hover { background: rgba(255,255,255,.22); }
.sheet-full .round:disabled { opacity: .35; }
.sheet-full .counter { color: rgba(255,255,255,.75); }
.sheet-full .segmented { background: rgba(255,255,255,.12); }
.sheet-full .segmented button { color: rgba(255,255,255,.75); }
.sheet-full .segmented button[aria-pressed="true"] { background: rgba(255,255,255,.95); color: #1d1d1f; }
.sheet-full .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: transparent; }
.sheet-full .btn-ghost:hover { background: rgba(255,255,255,.12); }
.sheet-full .toggle { color: #fff; }
.sheet-full .caption { color: rgba(255,255,255,.7); }
.sheet-full .viewer .viewer-nav { background: rgba(255,255,255,.12); box-shadow: none; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.sheet-full .viewer-nav .round { background: transparent; }
.sheet-full .viewer-nav .round:hover { background: rgba(255,255,255,.16); }
.sheet-full .pager button { background: rgba(255,255,255,.35); }
.sheet-full .pager button[aria-current="true"] { background: #fff; }
/* Dark browser chrome, like a real app window */
.sheet-full .browser { background: #1c1c1e; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 40px 100px rgba(0,0,0,.5); }
.sheet-full .browser-bar { background: #1c1c1e; border-bottom: 1px solid rgba(255,255,255,.06); }
.sheet-full .browser-bar .url { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.sheet-full .phone { box-shadow: 0 40px 100px rgba(0,0,0,.5); }
.zoom-btn.in-bar { position: static; width: 30px; height: 30px; margin-left: auto; flex: none; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; box-shadow: none; backdrop-filter: none; }
.zoom-btn.in-bar:hover { background: rgba(255,255,255,.18); }
.zoom-btn.in-bar .icon { width: 17px; height: 17px; }
/* Email notes: a frosted card floating next to the email */
.sheet-full .email-layout { gap: 0; }
.sheet-full .email-notes { margin: 16px 24px 24px 0; height: auto; border: 0; border-radius: 18px; background: rgba(255,255,255,.94); }
@media (max-width: 1000px) {
  .sheet-full .email-notes { margin: 0 12px 24px; border-top: 0; }
}
/* Graphics gallery on glass */
.sheet-full .gallery-stage { background: transparent; }
.backdrop { background: rgba(10,10,12,.84); backdrop-filter: saturate(140%) blur(32px); -webkit-backdrop-filter: saturate(140%) blur(32px); }
.scroll-fade { display: none; }
.phone .zoom-btn { bottom: auto; top: 26px; right: 22px; }

/* Zoom v2: scale the whole device, drag to pan */
.screen:has(img), .screen.zoomed { cursor: auto; }
.screen.zoomed img { width: 100%; }
.sheet-full .stage { position: relative; overflow: hidden; }
.sheet-full .stage .browser, .sheet-full .stage .phone { transition: transform .35s cubic-bezier(.2,.8,.2,1); transform-origin: center; will-change: transform; }
.sheet-full .stage.zoomed { cursor: grab; }
.sheet-full .stage.zoomed.dragging { cursor: grabbing; }
.sheet-full .stage.dragging .browser, .sheet-full .stage.dragging .phone { transition: none; }
.sheet-full .stage.zoomed .screen { user-select: none; }
.sheet-full .stage.zoomed img { pointer-events: none; -webkit-user-drag: none; }
.stage > .zoom-btn {
  position: absolute; right: 8px; bottom: 8px; top: auto; z-index: 5; width: 44px; height: 44px; border-radius: 50%;
  color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.12); box-shadow: none;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.stage > .zoom-btn:hover { background: rgba(255,255,255,.26); }
.sheet-full .stage { overflow: visible; }
.sheet-full .sheet-body { overflow: hidden !important; }
.sheet-full .sheet-head, .sheet-full .viewer-nav, .sheet-full .email-notes, .sheet-full .caption { position: relative; z-index: 6; }
.stage.zoomed .scroll-pill { opacity: 0; }
@media (max-width: 1000px) { .sheet-full .sheet-body.email-scroll { overflow: auto !important; } }
.sheet-full .viewer .viewer-nav { position: relative; z-index: 6; background: rgba(40,40,44,.75); }

/* Desktop frame follows the image's shape (set by fitFrames) */
.sheet-full .browser { width: min(100cqw, 1280px, (100cqh - 41px) * var(--ar, 1.6)); }
.sheet-full .browser .screen { aspect-ratio: var(--ar, 1.6); }
.sheet-full .viewer { gap: 18px; }

/* Mobile screens: no device bezel, just the screen with rounded corners */
.phone, .sheet-full .phone, .viewer .phone, .email-stage .phone, .sheet-full .email-stage .phone {
  padding: 0; background: #fff; border: 0; border-radius: 28px; overflow: hidden;
}
.phone .screen { border-radius: 28px; }
.phone::before, .phone::after { display: none !important; }
.sheet-full .phone { aspect-ratio: var(--par, 0.4621); height: min(100cqh, 820px, 100cqw / var(--par, 0.4621)); width: auto; max-width: 100cqw; }
.sheet-full .phone { box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.phone .popup-layer { inset: 0; border-radius: 28px; }
.phone .scroll-fade { left: 0; right: 0; bottom: 0; border-radius: 0 0 28px 28px; }
.phone .scroll-pill { bottom: 16px; }
.phone .zoom-btn { top: 12px; right: 12px; }
/* Mobile screens: small inner padding so rounded corners don't cut the image */
.phone, .sheet-full .phone, .viewer .phone, .email-stage .phone, .sheet-full .email-stage .phone { padding: 4px; border-radius: 30px; background: #fff; }
.phone .screen { border-radius: 26px; }
.phone .popup-layer { inset: 4px; border-radius: 26px; }

.contact-email { margin: 22px 0 0; font-size: 15px; color: var(--muted); }
.contact-email a { color: var(--link); }
.footer span a { color: inherit; }
.footer span a:hover { color: var(--link); }
.contact p.contact-email { margin: 24px auto 0; text-align: center; font-size: 15px; letter-spacing: -0.01em; }

/* Project viewer: dots always, pinned to the same spot at the bottom */
.sheet-full .sheet-body:has(> .viewer) { position: relative; }
.sheet-full .viewer { padding-bottom: 88px; }
.sheet-full .viewer .viewer-nav { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); }
.sheet-full .pager { gap: 2px; }
.sheet-full .pager button { width: 20px; height: 20px; padding: 7px; }

/* iPhone Safari fix: "Let's talk" pop-up had zero-height body */
.sheet.narrow { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
.sheet.narrow .sheet-body { flex: 0 1 auto; min-height: 0; }
@media (max-width: 760px) {
  .sheet.narrow { max-height: 92vh; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
}

/* ============ Hero: centered layout with laptop showcase ============ */
.hero.hero-split {
  min-height: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 72px 0 96px;
}
.hero-split .hero-copy { display: flex; flex-direction: column; align-items: center; }
.hero-split h1 { max-width: 18ch; font-size: clamp(40px, 5.4vw, 72px); }
.hero-split .hero-ctas { justify-content: center; }

.hero-devices {
  position: relative; display: block;
  width: min(1000px, 100%); margin-top: 56px;
  aspect-ratio: 1736 / 1006;
}
.hero-devices:hover { text-decoration: none; }
.hero-laptop { position: absolute; inset: 0; }
.hero-laptop-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  filter: drop-shadow(0 32px 36px rgba(0, 0, 0, .12));
}
/* Screen area measured from the laptop PNG */
.hero-laptop-screen {
  position: absolute; left: 11.81%; top: 6.86%; width: 76.38%; height: 82.01%;
  overflow: hidden; background: #f4f5f7;
  container-type: size;
}

/* Animated Lift stats dashboard (inline SVG, scales with the laptop).
   Default state is the finished dashboard, so it's complete without animation. */
.hero-dash { display: block; width: 100%; height: 100%; }
.hero-dash text { letter-spacing: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hero-dash.play .dash-card { animation: dashIn .6s var(--ease) both; animation-delay: var(--d, 0s); }
  .hero-dash.play .draw { stroke-dasharray: 1; animation: dashDraw var(--dur, .9s) cubic-bezier(.4, 0, .2, 1) both; animation-delay: var(--dd, 0s); }
  .hero-dash.play .grow-y { transform-box: fill-box; transform-origin: 50% 100%; animation: dashGrowY .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--dd, 0s); }
  .hero-dash.play .grow-x { transform-box: fill-box; transform-origin: 0 50%; animation: dashGrowX .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--dd, 0s); }
  .hero-dash.play .pop { transform-box: fill-box; transform-origin: center; animation: dashPop .35s ease-out both; animation-delay: var(--dd, 0s); }
  .hero-dash.play .fade { animation: dashFade .5s ease-out both; animation-delay: var(--dd, 0s); }
}
@keyframes dashIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dashDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dashGrowY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dashGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dashPop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes dashFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 760px) {
  .hero.hero-split { padding: 48px 0 64px; }
  .hero-split h1 { font-size: clamp(36px, 10vw, 48px); }
  .hero-devices { margin-top: 40px; }
}

/* Whole card is clickable: opens View project (buttons keep their own action) */
#grid .card { cursor: pointer; }

/* "Visit website" link in project pop-up headers */
.site-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--link); white-space: nowrap; min-height: 36px; }
.site-link .icon { width: 14px; height: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet-full .site-link { color: #4da3ff; }
