:root {
  --paper: #F6F5F1;
  --card: #FFFFFF;
  --ink: #1B1A2E;
  --muted: #666577;
  --line: #E2E0D8;
  --pen: #D93A6E;        /* raspberry pen for handwritten notes */
  --hl: #FFE45C;         /* highlighter */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --display: "Funnel Display", system-ui, sans-serif;
  --body: "Funnel Sans", system-ui, sans-serif;
  --hand: "Nanum Pen Script", "Comic Sans MS", cursive;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--pen); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Highlighter + handwriting */
mark {
  background: linear-gradient(transparent 55%, var(--hl) 55%, var(--hl) 92%, transparent 92%);
  color: inherit; padding: 0 2px;
}
.hand { font-family: var(--hand); color: var(--pen); font-size: 32px; line-height: 1; }

.link { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.link:hover { text-decoration-color: var(--pen); color: var(--pen); }

/* ---------- Header ---------- */
.site-header { padding-block: 22px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 24px; text-decoration: none; letter-spacing: -0.03em; }
.logo span { color: var(--pen); }
.site-header nav { display: flex; align-items: center; gap: 26px; font-size: 16px; }
.site-header nav a:not(.btn) { text-decoration: none; color: var(--muted); }
.site-header nav a:not(.btn):hover { color: var(--ink); }
@media (max-width: 600px) { .site-header nav .hide-sm { display: none; } .site-header nav { gap: 16px; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform .2s cubic-bezier(.2,.7,.2,1), background .2s;
}
.btn:hover { background: var(--pen); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Home hero ---------- */
.hero { padding-block: clamp(48px, 9vw, 120px) clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.hello { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: var(--pen); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 28px;
  overflow: hidden; transform: rotate(-4deg); position: relative;
  box-shadow: 0 0 0 4px var(--card);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hello .hand { font-size: 38px; }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(42px, 7vw, 92px); line-height: 1; letter-spacing: -0.04em;
  margin: 0; max-width: 14ch;
}
.hero p.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 36rem; margin: 28px 0 32px; }
.hero p.lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.note-card {
  background: var(--card); padding: 18px 22px 20px; border-radius: 14px; max-width: 250px;
  transform: rotate(2.5deg); box-shadow: 0 1px 0 var(--line), 0 12px 30px -18px rgba(27,26,46,.35);
}
.note-card .hand { font-size: 32px; display: block; }
.note-card .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2DB86B; margin-right: 8px; vertical-align: 2px; box-shadow: 0 0 0 4px #2DB86B22; }
.note-card p { margin: 10px 0 0; font-size: 15px; color: var(--muted); line-height: 1.45; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .note-card { justify-self: start; } }

@media (prefers-reduced-motion: no-preference) {
  .hero .hello, .hero h1, .hero .lede, .hero-actions, .note-card { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
  .hero h1 { animation-delay: .08s; } .hero .lede { animation-delay: .16s; }
  .hero-actions { animation-delay: .22s; } .note-card { animation-delay: .4s; }
  @keyframes rise { from { opacity: 0; translate: 0 14px; } }
}

/* ---------- Section heading ---------- */
.sec { padding-block: clamp(56px, 8vw, 110px); }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-title h2 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
.sec-title p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------- Device frames ---------- */
.browser {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -40px rgba(27,26,46,.45);
}
.browser-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.browser-bar .url { margin-left: 10px; font-size: 13px; color: var(--muted); background: var(--paper); padding: 3px 12px; border-radius: 999px; }
.screen {
  aspect-ratio: 16 / 10; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; position: relative; cursor: ns-resize;
}
.screen::-webkit-scrollbar { display: none; }
.screen img { width: 100%; }

.phone {
  width: clamp(130px, 17vw, 210px); aspect-ratio: 375 / 812;
  border-radius: 28px; padding: 7px; background: var(--ink);
  box-shadow: 0 30px 50px -30px rgba(27,26,46,.6);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 22px; }

/* ---------- Project (home) ---------- */
.project { display: grid; gap: 28px; }
.project + .project { margin-top: clamp(80px, 11vw, 150px); }
.stage { position: relative; padding-right: clamp(40px, 9vw, 120px); padding-bottom: 40px; }
.stage .phone { position: absolute; right: 0; bottom: 0; transform: rotate(3deg); }
.stage .callout { position: absolute; left: -6px; top: -44px; transform: rotate(-3deg); }
.stage .scroll-hint { position: absolute; right: clamp(150px, 20vw, 250px); bottom: 2px; transform: rotate(-2deg); font-size: 30px; }
@media (max-width: 700px) {
  .stage { padding-right: 0; padding-bottom: 0; }
  .stage .phone, .stage .scroll-hint { display: none; }
  .stage .callout { position: static; display: block; margin-bottom: 8px; }
}

.project-info { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px 56px; align-items: start; }
.project-info h3 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 12px; }
.project-info .one-liner { margin: 0; font-size: 20px; line-height: 1.45; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 22px; margin: 0 0 22px; font-size: 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.project-links { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 760px) { .project-info { grid-template-columns: 1fr; } }

/* ---------- Strengths ---------- */
.strengths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.strength { background: var(--card); border-radius: 16px; padding: 28px; }
.strength h3 { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; margin: 0 0 10px; line-height: 1.2; }
.strength p { margin: 0; color: var(--muted); font-size: 16px; }
.strength .hand { display: block; margin-top: 14px; font-size: 29px; }
@media (max-width: 860px) { .strengths { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px 72px; align-items: start; }
.about .big { font-family: var(--display); font-size: clamp(26px, 2.8vw, 36px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 600; margin: 0; }
.about .body p { margin: 0 0 1em; max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 24px 0 0; }
.chips li { font-size: 15px; padding: 6px 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--paper); border-radius: 24px; padding: clamp(36px, 6vw, 80px); position: relative; overflow: hidden; }
.contact h2 { font-family: var(--display); font-size: clamp(36px, 6vw, 76px); line-height: 1; letter-spacing: -0.04em; margin: 0 0 18px; }
.contact p { color: color-mix(in srgb, var(--paper) 72%, transparent); max-width: 44ch; margin: 0 0 30px; }
.contact .mail { font-family: var(--display); font-size: clamp(22px, 3.6vw, 40px); font-weight: 600; color: var(--paper); text-decoration-color: var(--pen); text-decoration-thickness: 3px; text-underline-offset: 8px; word-break: break-word; }
.contact .mail:hover { color: var(--hl); }
.contact .hand { color: var(--hl); position: absolute; right: clamp(24px, 5vw, 64px); top: clamp(24px, 4vw, 48px); transform: rotate(6deg); font-size: 34px; }
@media (max-width: 640px) { .contact .hand { position: static; display: block; margin-bottom: 14px; transform: rotate(-2deg); } }
.contact .btn { background: var(--paper); color: var(--ink); }
.contact .btn:hover { background: var(--hl); }

.site-footer { padding-block: 32px 44px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 20px; }

/* ============ Case study pages ============ */
.cs-hero { padding-block: clamp(36px, 6vw, 80px) 40px; }
.back { font-size: 16px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 28px; }
.back:hover { color: var(--ink); }
.cs-hero .kicker { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; margin-bottom: 18px; }
.cs-hero .kicker i { width: 14px; height: 14px; border-radius: 4px; background: var(--brand); }
.cs-hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 6vw, 80px); line-height: 1.02; letter-spacing: -0.04em; margin: 0; max-width: 18ch; }
.meta-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 16px; }
.meta-row dt { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.meta-row dd { margin: 0; }
@media (max-width: 760px) { .meta-row { grid-template-columns: 1fr 1fr; } }

.cs-section { padding-block: clamp(48px, 7vw, 96px); }
.prose { max-width: 40rem; }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3vw, 38px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 18px; }
.prose p { margin: 0 0 1em; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 72px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Annotated shots: the heart of each case study */
.annotated { position: relative; margin-top: 40px; }
.annotated .shot { border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -44px rgba(27,26,46,.5); background: var(--card); }
.pin {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  background: var(--pen); color: #fff; font-weight: 700; font-size: 15px;
  display: grid; place-items: center; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pen) 25%, transparent);
}
.notes { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px 32px; counter-reset: n; }
.notes li { counter-increment: n; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.notes li::before {
  content: counter(n); width: 30px; height: 30px; border-radius: 50%;
  background: var(--pen); color: #fff; font-weight: 700; font-size: 15px; display: grid; place-items: center;
}
.notes .hand { font-size: 31px; display: block; margin-bottom: 4px; }
.notes p { margin: 0; font-size: 16px; color: var(--muted); }

.devices { display: flex; gap: clamp(20px, 4vw, 48px); align-items: flex-end; justify-content: center; flex-wrap: wrap; background: var(--card); border-radius: 24px; padding: clamp(28px, 5vw, 64px); }
.devices .browser { flex: 1 1 520px; max-width: 760px; box-shadow: 0 0 0 1px var(--line); }
.devices .phone { width: clamp(170px, 20vw, 240px); }

.next { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: clamp(28px, 5vw, 56px); border-radius: 24px; background: var(--card); text-decoration: none; transition: background .25s; }
.next:hover { background: color-mix(in srgb, var(--brand-next) 10%, var(--card)); }
.next small { color: var(--muted); font-size: 15px; display: block; margin-bottom: 6px; }
.next strong { font-family: var(--display); font-size: clamp(28px, 4vw, 48px); letter-spacing: -0.03em; line-height: 1; }
.next .hand { font-size: 36px; }

.on-touch { display: none; }
@media (hover: none) { .on-hover { display: none; } .on-touch { display: inline; } }
