:root {
  --ink: #0A0D12;
  --muted: #717680;
  --body: #535862;
  --faint: #A4A7AE;
  --line: #E9EAEB;
  --line-soft: #F2F2F2;
  --dot: #D5D7DA;
  --panel: #F7F7F7;
  --panel-hover: #EFEFEF;
  --pill: #F5F5F5;
  --bg: #FFFFFF;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.25, .1, .25, 1);
}

* { box-sizing: border-box; }
@supports (corner-shape: superellipse(2)) { *, *::before, *::after { corner-shape: superellipse(1.9); } }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--muted); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ink); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .7s cubic-bezier(.05, .7, .1, 1) both; }

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
#home { display: flex; flex-direction: column; gap: 64px; }

/* Intro */
.intro { display: flex; flex-direction: column; gap: 28px; }
.portrait { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.name { display: flex; flex-direction: column; gap: 2px; }
.name h1 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 500; }
.name p { margin: 0; font-size: 15px; line-height: 22px; color: var(--muted); }
.bio { display: flex; flex-direction: column; gap: 16px; font-size: 16px; line-height: 25px; }
.bio p { margin: 0; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; }
.contact a { color: var(--ink); padding: 10px 0; }
.contact a:hover { color: var(--body); }
.contact span { color: var(--faint); }

/* Tabs */
.work { display: flex; flex-direction: column; gap: 24px; }
.tabs { display: flex; gap: 8px; }
.pill {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.pill:hover { color: var(--ink); }
.pill[aria-selected="true"] { background: var(--pill); border-color: var(--pill); color: var(--ink); }

/* Work list: one large card per row. Every cover is a screenshot in a browser window
   (or a phone for app-only work) floating on the same grey panel. */
.grid { display: grid; grid-template-columns: 1fr; gap: 64px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 24px;
  background: var(--panel);
  overflow: hidden;
  container-type: inline-size;
  transition: background-color 1.2s var(--ease-soft);
}
.cover .frame { position: absolute; transition: transform 1.6s var(--ease-out); will-change: transform; }
.cover .frame-web { left: 10%; top: 10%; width: 80%; }
.cover .frame-phone { left: 37%; top: 8%; width: 26%; }
/* Three phones for app-only work: the middle one leads. */
.trio-0, .trio-2 { position: absolute; top: 15%; width: 21%; }
.trio-0 { left: 14%; }
.trio-2 { left: 65%; }
.trio-1 { position: absolute; left: 37.5%; top: 8%; width: 25%; z-index: 1; }
/* Hover only ever affects the card under the pointer: no card looks "active" on its own. */
@media (hover: hover) {
  .card:hover .cover { background-color: var(--panel-hover); }
  .card:hover .frame { transform: translateY(-6px); }
}
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 24px; }
.card .meta { display: flex; flex-direction: column; gap: 6px; }
.card .title { font-size: 18px; line-height: 26px; font-weight: 500; }
.card .desc { font-size: 17px; line-height: 27px; color: var(--ink); }
.card .byline { font-size: 15px; line-height: 22px; color: var(--muted); }

.foot { font-size: 13px; color: var(--muted); }

/* Case study */
.case { display: flex; flex-direction: column; gap: 48px; padding-bottom: 24px; }
.cs-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 500;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  transition: color .6s var(--ease-out);
}
.cs-back:hover { color: var(--ink); }
.cs-head { display: flex; flex-direction: column; gap: 12px; }
.cs-tag { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--pill); font-size: 13px; font-weight: 500; color: var(--body); }
.cs-head h1 { margin: 0; font-size: 44px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.cs-head p { margin: 0; font-size: 18px; line-height: 28px; color: var(--muted); }

.cs-hero { position: relative; width: 100%; aspect-ratio: 16 / 11; border-radius: 24px; background: var(--panel); overflow: hidden; container-type: inline-size; }
.browser {
  display: flex;
  flex-direction: column;
  font-size: 1.15cqw;
  border-radius: 0.9em;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(10 13 18 / 4%), 0 2.4em 4.8em -1.6em rgb(10 13 18 / 14%);
}
.browser .bar { display: flex; align-items: center; gap: 1.2em; flex: none; height: 3.4em; padding: 0 1.4em; background: var(--bg); border-bottom: 1px solid var(--line-soft); color: var(--faint); }
.browser .lights { display: flex; gap: 0.55em; }
.browser .lights i { width: 0.95em; height: 0.95em; border-radius: 999px; background: #FF5F57; }
.browser .lights i:nth-child(2) { background: #FEBC2E; }
.browser .lights i:nth-child(3) { background: #28C840; }
.browser .nav, .browser .tools { width: 3.4em; height: 1.4em; flex: none; }
.browser .url { flex: 1; max-width: 46%; height: 1.9em; margin: 0 auto; border-radius: 0.6em; background: var(--pill); }
.browser img, .browser .empty { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.empty { display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.device {
  display: block;
  aspect-ratio: 9 / 19.5;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(10 13 18 / 4%), 0 24px 48px -16px rgb(10 13 18 / 16%);
}
.device img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cs-hero .browser, .cs-hero .device { position: absolute; }

.cs-meta { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cs-meta div { display: flex; flex-direction: column; gap: 4px; padding-bottom: 16px; }
.cs-meta dt { font-size: 13px; color: var(--muted); }
.cs-meta dd { margin: 0; font-size: 15px; line-height: 22px; }

.cs-text { display: flex; flex-direction: column; gap: 32px; }
.cs-text div { display: flex; flex-direction: column; gap: 8px; }
.cs-text h2, .cs-outcome h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.cs-text p, .cs-outcome > p { margin: 0; font-size: 16px; line-height: 26px; color: var(--body); }

.cs-fig { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.cs-fig .panel { border-radius: 24px; background: var(--panel); padding: 40px; container-type: inline-size; }
.cs-fig .phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cs-fig .device { border-radius: 16px; }
.cs-fig figcaption { font-size: 14px; color: var(--muted); }

.cs-outcome { display: flex; flex-direction: column; gap: 20px; }
.cs-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cs-results div { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 16px; background: var(--panel); }
.cs-results strong { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.cs-results span { font-size: 14px; line-height: 20px; color: var(--muted); }

.cs-next { display: block; width: 100%; padding: 0; margin: 8px 0 0; border: 0; background: none; text-align: left; cursor: pointer; }
.cs-next .panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; border-radius: 20px; background: var(--panel); transition: background-color 1.2s var(--ease-soft); }
.cs-next .label { display: flex; flex-direction: column; gap: 2px; }
.cs-next small { font-size: 13px; color: var(--muted); }
.cs-next strong { font-size: 20px; line-height: 28px; font-weight: 600; }
.cs-next svg { transition: transform 1.6s var(--ease-out); }
@media (hover: hover) {
  .cs-next:hover .panel { background-color: var(--panel-hover); }
  .cs-next:hover svg { transform: translateX(8px); }
}
.cs-back:focus-visible, .cs-next:focus-visible, .pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Phone */
@media (max-width: 640px) {
  .page { padding: 40px 20px 64px; gap: 40px; }
  #home { gap: 40px; }
  .intro { gap: 24px; }
  .phone-no { display: none; }
  .work { gap: 20px; }
  .grid { gap: 48px; }
  .cover { border-radius: 16px; }
  .browser { font-size: 1.6cqw; }
  .device { border-radius: 12px; }
  .card:active .cover { transform: scale(.98); transition: transform .35s cubic-bezier(.2, 0, 0, 1); }
  .case { gap: 36px; }
  .cs-head h1 { font-size: 30px; }
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-fig .panel { padding: 14px; }
  .cs-fig .phones { gap: 8px; }
  .cs-results { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .cover, .cover .frame, .pill, .cs-back, .cs-next .panel, .cs-next svg { transition: none; }
}
