/* HanLab v2 — components and layout. Values come from tokens.css only. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/var(--lh-base) var(--font-sans);
  letter-spacing: var(--tracking);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap-wide { width: min(var(--wide), 100% - 2 * var(--gutter)); margin-inline: auto; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s-4); top: -100px; z-index: 100; background: var(--cream); color: var(--on-cream); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); }
.skip:focus { top: var(--s-2); }

/* type */
.display { font-size: var(--fs-display); font-weight: 700; line-height: 1.22; letter-spacing: -0.035em; }
.lead { font-size: var(--fs-lg); line-height: var(--lh-lg); color: var(--text-2); }
.section-lead { margin-top: var(--s-5); max-width: 36em; }
.sub { font-size: var(--fs-base); font-weight: 700; margin: var(--s-8) 0 var(--s-4); }
.footnote { margin-top: var(--s-3); font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-muted); }
.text-link { display: inline-block; margin-top: var(--s-7); color: var(--accent-2); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }

/* buttons, badges */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.btn-row--center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-family: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: filter var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--cream { height: 56px; padding: 0 30px; font-size: var(--fs-base); background: var(--cream); color: var(--on-cream); }
.btn--accent { height: 46px; padding: 0 20px; font-size: var(--fs-sm); background: var(--accent); color: var(--on-accent); border-radius: 12px; }
.btn--ghost { height: 46px; padding: 0 20px; font-size: var(--fs-sm); background: transparent; color: var(--text); border-color: var(--border-strong); border-radius: 12px; }
.btn--ghost:hover { border-color: var(--text); }
.btn--lg { height: 56px; padding: 0 28px; font-size: var(--fs-base); border-radius: var(--r-pill); }
.badge { display: inline-flex; align-items: center; gap: var(--s-2); padding: 5px 12px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; }
.badge--live { background: var(--surface-2); color: var(--live); }
.badge--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(126, 213, 140, .2); }
.badge--wip { background: var(--surface-2); color: var(--award); }

/* T01 header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
}
.site-header::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  background: var(--accent); transform-origin: left; transform: scaleX(var(--progress, 0));
}
.header-row { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.02em; text-decoration: none; }
.wordmark__mark { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); position: relative; flex: none; }
.wordmark__mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg); }
.nav__list { display: flex; align-items: center; gap: var(--s-1); font-size: var(--fs-sm); font-weight: 500; }
.nav__list a { display: block; padding: 8px 14px; text-decoration: none; color: var(--text-2); border-radius: var(--r-pill); transition: color var(--t-fast), background-color var(--t-fast); }
.nav__list a:hover { color: var(--text); background: var(--surface); }
.nav__list .nav__cta { margin-left: var(--s-2); background: var(--accent); color: var(--on-accent); font-weight: 700; }
.nav__list .nav__cta:hover { background: var(--accent); color: var(--on-accent); filter: brightness(1.06); }
.nav__toggle { display: none; width: 44px; height: 44px; padding: 13px 11px; background: none; border: 0; cursor: pointer; }
.nav__toggle .bar { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--t-fast); }
.nav__toggle .bar + .bar { margin-top: 6px; }

/* T02 hero */
.hero { padding-top: clamp(64px, 9vw, 120px); text-align: center; overflow: hidden; }
.hero__mark { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: var(--fs-lg); margin-bottom: var(--s-5); }
.hero .display { font-size: clamp(40px, 5.6vw, 72px); }
.hero .lead { margin: var(--s-5) auto var(--s-7); max-width: 34em; }
.hero .lead strong { color: var(--text); font-weight: 600; }

/* giant type + glass */
.giant-stage { position: relative; overflow: hidden; padding: var(--s-8) 0; --glass-zoom: 1.18; }
.giant-stage--hero { padding: clamp(48px, 7vw, 96px) 0 clamp(64px, 9vw, 120px); }
.giant {
  margin: 0 auto; width: max-content; max-width: none;
  font: 400 var(--fs-giant)/.86 var(--font-display); letter-spacing: 0;
  text-transform: uppercase; text-align: center; white-space: nowrap; color: var(--text);
  -webkit-user-select: none; user-select: none;
}
.giant > span { display: block; }
.g-dot { color: var(--accent); }
.glass {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; will-change: transform;
  width: clamp(110px, 16vw, 230px); aspect-ratio: 1 / 2.05; border-radius: clamp(26px, 3.2vw, 44px);
}
.glass--orb { width: clamp(150px, 20vw, 290px); aspect-ratio: 1; border-radius: 50%; }
.glass--mini { width: clamp(84px, 9vw, 120px); }
.glass__lens {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: rgba(0, 0, 0, .52);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.giant--copy { position: absolute; margin: 0; color: var(--accent); text-shadow: -4px 0 rgba(143, 211, 168, .75), 4px 0 rgba(227, 200, 115, .35); }
.giant--copy .g-dot { color: var(--cream); }
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(143, 211, 168, .22));
  box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 24px 40px rgba(255, 255, 255, .08), inset 0 -40px 60px rgba(0, 0, 0, .45), 0 50px 90px rgba(0, 0, 0, .55);
}
.glass--phone::before { content: ""; position: absolute; z-index: 3; top: 12px; left: 50%; width: 30%; height: 8px; translate: -50% 0; border-radius: 99px; background: rgba(242, 246, 238, .22); }
.glass--orb::after { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 30%), radial-gradient(circle at 70% 80%, rgba(143, 211, 168, .25), rgba(255, 255, 255, 0) 45%); }

/* sections */
.section { padding: var(--section-y) 0; }
.meta-label { text-align: right; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-muted); margin-bottom: var(--s-7); }
.meta-label b { display: block; color: var(--accent); font-weight: 500; }

/* T03 journey */
.journey { margin-top: var(--s-8); border-top: 1px solid var(--border); }
.journey li { display: grid; grid-template-columns: 200px 1fr; gap: var(--s-5); padding: var(--s-5) 0; border-bottom: 1px solid var(--border); }
.journey time { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.journey p { color: var(--text-2); }

/* T04 philosophy */
.philosophy { padding-bottom: 0; }
.statement { margin: var(--s-7) auto 0; max-width: 24em; font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; line-height: 1.5; letter-spacing: -0.03em; }
.statement .w { color: var(--statement-off); transition: color .35s var(--ease); }
.statement .w.on { color: var(--text); }
.giant-stage--orb { padding: var(--s-9) 0 var(--section-y); --glass-zoom: 1.35; }

/* T05 tabs */
.tabs { display: flex; gap: var(--s-1); margin: var(--s-7) 0 var(--s-8); border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 14px 20px; font: 600 var(--fs-base) var(--font-sans); letter-spacing: var(--tracking);
  color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text-2); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
html:not(.js) .tabs { display: none; }
html:not(.js) .panel + .panel { margin-top: var(--s-9); }
.panel:focus-visible { outline-offset: 8px; }
.panel__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); color: var(--text-muted); }
.panel__title { font: 700 clamp(32px, 4vw, 48px)/1.2 var(--font-sans); letter-spacing: -0.035em; margin: var(--s-3) 0 var(--s-5); }
.panel > .lead { max-width: 38em; }
.bullets { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); margin-top: var(--s-8); }
.bullets h4 { font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--s-4); }
.bullets li { position: relative; padding-left: 18px; color: var(--text-2); }
.bullets li + li { margin-top: var(--s-3); }
.bullets li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-8); }
.shots img { width: 100%; aspect-ratio: 636 / 1048; object-fit: cover; border-radius: var(--r-md); background: var(--surface); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
.metric { background: var(--surface); border-radius: var(--r-md); padding: var(--s-5); }
.metric dt { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-muted); }
.metric dd { margin-top: var(--s-2); font-size: clamp(32px, 3.4vw, 42px); font-weight: 700; line-height: 1.1; letter-spacing: -0.035em; color: var(--accent); font-variant-numeric: tabular-nums; }
.metric dd small { font-size: .45em; font-weight: 600; margin-left: 3px; color: var(--text-2); }

.ranks { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-6); align-items: start; }
.ranks li { background: var(--surface); border-radius: var(--r-md); padding: 8px; }
.ranks img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 12px; }
.ranks p { padding: var(--s-3) 6px 4px; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-muted); }
.ranks b { display: block; font-size: var(--fs-lg); line-height: 1.3; color: var(--accent); }

.wip { display: flex; align-items: center; gap: var(--s-5); margin-top: var(--s-8); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-lg); }
.wip img { width: 84px; height: 84px; border-radius: 20px; flex: none; }
.wip p { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.wip b { display: block; margin: var(--s-2) 0 2px; font-size: var(--fs-lg); color: var(--text); }

.result { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-6); }
.result table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.result th, .result td { padding: var(--s-3) 4px; text-align: right; border-bottom: 1px solid var(--border); }
.result thead th { font-weight: 500; font-size: var(--fs-xs); color: var(--text-muted); }
.result th:first-child { text-align: left; }
.result tbody th { font-weight: 700; }
.result td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.result s { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.gain { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-5); }
.gain p { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); font-size: var(--fs-xs); color: var(--text-2); }
.gain span { display: block; font-size: clamp(30px, 3.2vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -0.035em; color: var(--accent); }

/* T06 projects */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); margin-top: var(--s-8); }
.pcard { position: relative; aspect-ratio: 16 / 10.4; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.pcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-base) var(--ease); }
.pcard:hover img { transform: scale(1.04); }
.pcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .8) 38%, rgba(0, 0, 0, .3) 66%, rgba(0, 0, 0, .9) 100%); }
.pcard__text { position: absolute; z-index: 1; inset: var(--s-6) var(--s-6) auto; }
.pcard__text h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -0.03em; }
.pcard__text p { margin-top: 6px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); max-width: 26em; }
.pcard__text span { display: block; margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--text-muted); }
.pcard__role { position: absolute; z-index: 1; left: var(--s-6); bottom: var(--s-5); font-size: var(--fs-sm); font-weight: 700; color: var(--accent); }
.pcard__role--award { color: var(--award); }

/* T07 faq */
.info { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-7); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.info__icon { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--accent); }
.info a, .qa a { color: var(--accent-2); }
.qa dt { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 700; margin-top: var(--s-8); }
.qa dt:first-child { margin-top: 0; }
.qa dd { margin-top: var(--s-3); color: var(--text-2); max-width: 44em; }

/* T08 contact */
.contact { padding-top: 0; }
.ccard { display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: 360px; background: var(--surface); border-radius: 32px; overflow: hidden; }
.ccard__copy { padding: var(--s-8) var(--s-6); text-align: center; }
.ccard__kicker { color: var(--accent); font-weight: 600; }
.ccard__title { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.35; letter-spacing: -0.035em; margin: var(--s-4) 0 var(--s-3); }
.ccard__mail { margin-bottom: var(--s-6); font-size: var(--fs-sm); }
.ccard__mail a, .ccard__links a { color: var(--accent-2); text-decoration: none; border-bottom: 1px solid currentColor; }
.ccard__links { margin-top: var(--s-5); font-size: var(--fs-sm); }
.giant-stage--mini { padding: var(--s-6) 0; --fs-giant: clamp(96px, 11vw, 150px); }

/* T09 footer */
.site-footer { margin-top: var(--section-y); padding: var(--s-8) 0 var(--s-6); border-top: 1px solid var(--border); background: var(--bg-alt); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: var(--s-6) var(--s-9); align-items: flex-start; }
.footer-row b { color: var(--text); }
.footer-row a { text-decoration: none; color: var(--text-2); }
.footer-row a:hover { color: var(--text); }
.footer-top { margin-left: auto; }
.footer-copy { margin-top: var(--s-7); font-size: var(--fs-xs); }

/* scroll reveal (class added by JS only) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.is-in { opacity: 1; transform: none; }

/* responsive */
@media (max-width: 860px) {
  .bullets, .cards, .ccard { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .ccard__copy { padding-bottom: 0; }
}
@media (max-width: 640px) {
  :root { --fs-base: 16px; --lh-base: 27px; --fs-lg: 17px; --lh-lg: 28px; --fs-giant: 24vw; }
  .nav__toggle { display: block; }
  .nav__list {
    position: absolute; top: var(--header-h); left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-2) var(--gutter) var(--s-5);
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav__list.is-open { display: flex; }
  .nav__list a { padding: var(--s-3) 0; font-size: var(--fs-lg); border-radius: 0; }
  .nav__list a:hover { background: none; }
  .nav__list .nav__cta { margin: var(--s-2) 0 0; text-align: center; padding: var(--s-3); border-radius: 12px; }
  .nav__toggle[aria-expanded="true"] .bar:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .bar:last-child { transform: translateY(-4px) rotate(-45deg); }
  .hero .lead br { display: none; }
  .g-row > span { display: block; }
  .g-row .g-dot { display: none; }
  .glass--phone { width: 92px; border-radius: 22px; }
  .glass--orb { width: 128px; }
  .glass--mini { width: 80px; }
  .giant-stage--mini { --fs-giant: 26vw; }
  .journey li { grid-template-columns: 1fr; gap: 2px; }
  .tab { padding: 12px 14px; font-size: var(--fs-sm); }
  .shots, .ranks { grid-template-columns: repeat(3, 72%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-2); }
  .shots li, .ranks li { scroll-snap-align: start; }
  .result { padding: var(--s-4); }
  .result th, .result td { padding: var(--s-2) 2px; font-size: var(--fs-xs); }
  .wip { align-items: flex-start; }
  .wip img { width: 64px; height: 64px; border-radius: 16px; }
  .pcard { aspect-ratio: 4 / 4.2; }
  .pcard__text { inset: var(--s-5) var(--s-5) auto; }
  .pcard__role { left: var(--s-5); }
  .ccard__copy { padding: var(--s-7) var(--s-5) 0; }
  .footer-top { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .pcard:hover img { transform: none; }
  .statement .w { transition: none; }
}
