/* DobbyLab. Family with gtree (the squirrel's teal, cream and orange; Bricolage Grotesque),
   but its own voice: a drenched teal frame top and bottom, a cream page between, and a thin
   "branch" rail down the left that ties the sections together like a commit graph. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(/fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  --paper: oklch(0.972 0.014 78);
  --paper-2: oklch(0.945 0.02 76);
  --ink: oklch(0.25 0.03 214);
  --ink-2: oklch(0.38 0.025 214);
  --mute: oklch(0.49 0.02 214);
  --line: oklch(0.87 0.02 76);
  --teal: oklch(0.355 0.042 213);       /* the squirrel icon's background */
  --teal-deep: oklch(0.3 0.04 213);
  --on-teal: oklch(0.94 0.035 78);      /* the squirrel's cream belly */
  --on-teal-2: oklch(0.82 0.03 200);
  --teal-line: oklch(0.47 0.035 213);
  --orange: oklch(0.69 0.15 50);        /* the squirrel's fur */
  --orange-text: oklch(0.53 0.15 44);   /* orange that passes AA on paper */
  --rail: oklch(0.8 0.03 76);
  --card: oklch(0.99 0.008 80);
  --line-strong: oklch(0.8 0.025 76);
  --shadow: 0 1px 2px oklch(0.3 0.04 213 / 0.08), 0 24px 60px -18px oklch(0.3 0.04 213 / 0.35);

  --display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;

  --gutter: clamp(16px, 5vw, 72px);
  --max: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
:root:lang(ja) {
  --display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.2 0.022 214);
    --paper-2: oklch(0.235 0.025 214);
    --ink: oklch(0.94 0.02 78);
    --ink-2: oklch(0.84 0.02 78);
    --mute: oklch(0.7 0.02 200);
    --line: oklch(0.32 0.025 214);
    --teal: oklch(0.3 0.045 213);
    --teal-deep: oklch(0.255 0.04 213);
    --teal-line: oklch(0.42 0.04 213);
    --orange-text: oklch(0.76 0.14 55);
    --rail: oklch(0.36 0.03 214);
    --card: oklch(0.235 0.025 214);
    --line-strong: oklch(0.42 0.03 214);
    --shadow: 0 0 0 1px oklch(0.4 0.03 214 / 0.5), 0 28px 70px -20px oklch(0.08 0.02 214 / 0.8);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:lang(ja) body, :lang(ja) p, :lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { line-break: strict; word-break: auto-phrase; }
:lang(zh-CN) p, :lang(zh-CN) h2, :lang(zh-CN) h3 { line-break: strict; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 3px; }
::selection { background: oklch(0.69 0.15 50 / 0.3); }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--on-teal); color: var(--teal-deep); padding: 10px 14px; border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- language switch (shared) ---------- */
.langs { display: flex; gap: 2px; font-size: 0.875rem; }
.langs a { text-decoration: none; padding: 4px 9px; border-radius: 999px; opacity: 0.72; transition: opacity 0.2s, background-color 0.2s; }
.langs a:hover { opacity: 1; }
.langs a[aria-current='page'] { opacity: 1; background: color-mix(in oklch, currentColor 14%, transparent); }

/* ---------- hero: the surface is the squirrel's teal ---------- */
.hero {
  background: var(--teal);
  color: var(--on-teal);
  container-type: inline-size;
  overflow: clip;
}
.top {
  display: flex; align-items: center; gap: 24px;
  padding-block: 22px;
  font-size: 0.9375rem;
}
.brand { margin-right: auto; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand span { font: 700 1.2rem/1 var(--display); font-stretch: 85%; letter-spacing: -0.01em; }
.links { display: flex; gap: 22px; }
.links a { text-decoration: none; }
.links a:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 6px; text-decoration-thickness: 2px; }

.hero-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  padding-top: clamp(56px, 11vw, 150px);
}
.statement {
  grid-column: 1 / span 8;
  font: 600 clamp(1.85rem, 4.6vw, 3.9rem)/1.06 var(--display);
  font-stretch: 92%;
  letter-spacing: -0.025em;
  max-width: 17ch;
  animation: lift 0.9s var(--ease) both 0.1s;
}
:lang(ja) .statement, :lang(zh-CN) .statement { max-width: 15em; font-size: clamp(1.6rem, 3.6vw, 3rem); line-height: 1.3; letter-spacing: 0; }
.sub {
  grid-column: 1 / span 6;
  margin-top: 22px;
  max-width: 46ch;
  color: var(--on-teal-2);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  animation: lift 0.9s var(--ease) both 0.2s;
}
:lang(ja) .sub, :lang(zh-CN) .sub { max-width: 30em; }
.sub a { color: var(--on-teal); font-weight: 600; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sub a:hover { text-decoration-thickness: 3px; }
.wordmark {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: clamp(48px, 8vw, 110px);
  margin-bottom: -0.065em;             /* baseline on the band edge (baseline is 0.73em into the 0.8em line box); the y tail is cropped */
  margin-left: -0.04em;
  /* fill the content width: the word is ~3.1em wide including the full stop */
  font: 800 calc((min(100cqi, var(--max) + var(--gutter) * 2) - var(--gutter) * 2) / 3.15)/0.8 var(--display);
  font-stretch: 75%;
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.02em;             /* tighter makes glyphs overlap and shows hairline seams */
  white-space: nowrap;
  color: var(--on-teal);
  animation: rise 1.1s var(--ease) both;
}
.wordmark::after {                       /* an acorn-orange full stop */
  content: '';
  display: inline-block;
  width: 0.12em; height: 0.12em;
  margin-left: 0.04em;
  border-radius: 50%;
  background: var(--orange);
}
@keyframes rise { from { transform: translateY(22%); opacity: 0; } }
@keyframes lift { from { transform: translateY(14px); opacity: 0; } }

/* ---------- sections: quiet label on the left, the thing itself on the right ---------- */
main { position: relative; }
.sec { padding-block: clamp(96px, 12vw, 168px) 0; }
.sec-values { padding-bottom: clamp(96px, 12vw, 168px); }
.sec-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 28px clamp(32px, 5vw, 80px);
  align-items: start;
}
.sec-h {
  position: relative;
  font: 650 1.25rem/1.3 var(--display);
  letter-spacing: -0.01em;
  padding-top: 6px;
}
:lang(ja) .sec-h, :lang(zh-CN) .sec-h { letter-spacing: 0; font-weight: 600; }

/* The rail: one branch line running down the page, a node at each section, like a commit graph. */
.node { display: none; }
@media (min-width: 1000px) {
  :root { --content-left: max(var(--gutter), (100vw - var(--max)) / 2); --rail-off: calc(var(--gutter) * 0.6); }
  .hero + main::before {
    content: ''; position: absolute; top: 0; bottom: 0;
    left: calc(var(--content-left) - var(--rail-off) - 1px);
    width: 2px; background: var(--rail);
  }
  .contact { position: relative; }
  .contact::before { content: ''; position: absolute; top: 0; bottom: 0; left: calc(var(--content-left) - var(--rail-off) - 1px); width: 2px; background: var(--teal-line); }
  .node {
    display: block; position: absolute; z-index: 1;
    top: 0.62em; left: calc(var(--rail-off) * -1 - 7px);
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--paper); border: 3px solid var(--orange);
  }
  .contact .node { background: var(--teal); }
  .sec-h { position: sticky; top: 32px; }
}

/* ---------- work: gtree shown as a piece, not a feature list ---------- */
.work {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3.4vw, 44px) clamp(22px, 3.4vw, 44px) 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  transition: border-color 0.3s var(--ease);
}
.work:hover { border-color: var(--line-strong); }
.work:has(a:focus-visible) { outline: 2px solid var(--orange); outline-offset: 4px; }
.work a:focus-visible { outline: none; }
.work-head { display: flex; align-items: center; gap: 20px; }
.work-icon { width: 72px; height: 72px; flex: none; border-radius: 16px; }
.work-title { min-width: 0; }
.work-name {
  font: 800 clamp(2.4rem, 4.2vw, 3.4rem)/0.9 var(--display);
  font-stretch: 75%;
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.03em;
}
.work-name a { text-decoration: none; }
.work-name a::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; } /* the whole card is the link */
.work-line { margin-top: 8px; max-width: 42ch; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.5; color: var(--ink-2); }
:lang(ja) .work-line, :lang(zh-CN) .work-line { max-width: 28em; }
.work-cta {
  flex: none; margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px 11px 20px; border-radius: 999px;
  background: var(--teal); color: var(--on-teal);
  font-weight: 600; font-size: 0.9375rem;
  transition: background-color 0.3s var(--ease);
}
.work-cta svg { transition: transform 0.4s var(--ease); }
.work:hover .work-cta { background: var(--teal-deep); }
.work:hover .work-cta svg { transform: translateX(4px); }
.work-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.work-meta li {
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8125rem; color: var(--mute);
}
.work-shot { height: clamp(200px, 30vw, 440px); margin-top: clamp(28px, 4vw, 44px); overflow: hidden; }
.work-shot img {
  width: 100%;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow);
  transform: translateY(14px);
  transition: transform 0.7s var(--ease);
}
.work:hover .work-shot img { transform: translateY(0); }
@media (prefers-color-scheme: dark) {
  .work-cta { background: var(--on-teal); color: var(--teal-deep); }
  .work:hover .work-cta { background: oklch(0.88 0.04 78); }
}

/* ---------- values: what we care about, said in one line each ---------- */
.values li {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  column-gap: 12px;
  padding-block: 30px;
  border-top: 1px solid var(--line);
}
.values li:first-child { border-top: 0; padding-top: 0; }
.num { font: 700 1.25rem/1.5 var(--display); font-stretch: 75%; color: var(--orange-text); font-variant-numeric: tabular-nums; padding-top: 0.35em; }
.values h3 { font: 700 clamp(1.6rem, 3vw, 2.5rem)/1.1 var(--display); font-stretch: 85%; letter-spacing: -0.025em; }
:lang(ja) .values h3, :lang(zh-CN) .values h3 { letter-spacing: 0; line-height: 1.3; font-size: clamp(1.4rem, 2.5vw, 2.1rem); }
.values p { grid-column: 2; margin-top: 10px; max-width: 52ch; color: var(--ink-2); }
:lang(ja) .values p, :lang(zh-CN) .values p { max-width: 34em; }

/* ---------- contact + footer: back into the teal ---------- */
.contact, .foot { background: var(--teal); color: var(--on-teal); }
.contact { padding-block: clamp(96px, 12vw, 160px) clamp(64px, 8vw, 100px); }
.c-body { display: grid; gap: 20px; justify-items: start; }
.c-text { max-width: 54ch; color: var(--on-teal-2); }
:lang(ja) .c-text, :lang(zh-CN) .c-text { max-width: 36em; }
.c-mail {
  margin-top: 12px;
  font: 700 clamp(1.6rem, 5.4vw, 4.8rem)/1 var(--display);
  font-stretch: 78%;
  letter-spacing: -0.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--orange), var(--orange)) 0 100% / 0 0.07em no-repeat;
  padding-bottom: 0.08em;
  transition: background-size 0.5s var(--ease);
}
.c-mail:hover, .c-mail:focus-visible { background-size: 100% 0.07em; }
.c-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.c-links a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--teal-line);
  border-radius: 999px;
  text-decoration: none;
  transition: border-color 0.25s, background-color 0.25s;
}
.c-links a:hover { border-color: var(--on-teal-2); background: color-mix(in oklch, var(--on-teal) 8%, transparent); }

.foot { font-size: 0.875rem; color: var(--on-teal-2); }
.foot-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding-block: 22px 28px;
  border-top: 1px solid var(--teal-line);
}
.foot-row p { margin-right: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--on-teal); }

/* ---------- plain pages (privacy, 404) ---------- */
.plain .bar { background: var(--teal); color: var(--on-teal); }
.bar-row { display: flex; align-items: center; justify-content: space-between; padding-block: 18px; }
.doc { max-width: calc(68ch + var(--gutter) * 2); padding-block: clamp(56px, 9vw, 110px); display: grid; gap: 18px; }
.doc h1 { font: 750 clamp(2.6rem, 7vw, 4.8rem)/0.95 var(--display); font-stretch: 80%; letter-spacing: -0.03em; margin-bottom: 4px; }
:lang(ja) .doc h1, :lang(zh-CN) .doc h1 { letter-spacing: 0; line-height: 1.15; }
.doc-date { color: var(--mute); font-size: 0.9375rem; }
.doc a { color: var(--orange-text); text-underline-offset: 3px; }
.doc-back { margin-top: 18px; }
.nf { gap: 40px; }
.nf h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.plain .foot { margin-top: auto; }
.plain { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- small screens ---------- */
@media (max-width: 999px) {
  .statement { grid-column: 1 / -1; }
  .sub { grid-column: 1 / span 10; }
  .sec-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  .links { display: none; }
  .top { padding-block: 16px; }
  .sub { grid-column: 1 / -1; }
  .work { border-radius: 18px; }
  .work-head { flex-wrap: wrap; gap: 16px; }
  .work-icon { width: 56px; height: 56px; border-radius: 13px; }
  .work-cta { order: 3; margin-left: 0; }
  .values li { grid-template-columns: 2.5rem minmax(0, 1fr); padding-block: 24px; }
  .foot-row p { width: 100%; }
}
@media (max-width: 420px) {
  .top { gap: 8px; }
  .langs a { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
