/* Hallmark · macrostructure: Map / Diagram · tone: technical, field-survey · anchor hue: survey orange (42°)
 * nav: N5 floating pill · footer: Ft2 inline single line · enrichment: interactive WebGPU contour map (liquid-dom)
 * tasteskill dials: VARIANCE 7 · MOTION 5 · DENSITY 4
 * Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V5 */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  background: var(--color-paper);
  color: var(--color-ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-style: normal;
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
}
p { text-wrap: pretty; }
.mono { font-family: var(--font-mono); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--space-lg); }

/* ---------- buttons (pill) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 var(--space-lg);
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--text-sm); letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-solid { background: var(--color-ink); color: var(--color-paper); }
.btn-solid:hover { background: var(--color-accent); color: var(--color-on-accent); }
.btn-line { box-shadow: inset 0 0 0 var(--rule-hair) var(--color-ink); }
.btn-line:hover { background: var(--color-paper-2); }
.btn-small { min-height: 36px; padding: 0 var(--space-md); }

/* ---------- nav: floating glass pill (web approximation of Liquid Glass, not Apple's material) ---------- */
.nav-wrap {
  position: sticky; top: var(--space-md); z-index: 20;
  display: flex; justify-content: center; padding-inline: var(--space-md);
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--space-2xs);
  padding: 5px 5px 5px var(--space-md);
  border-radius: var(--radius-pill);
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow:
    inset 0 1px 0 var(--color-glass-edge),
    inset 0 0 0 var(--rule-hair) var(--color-glass-shade),
    0 10px 30px -14px var(--color-glass-shade);
}
.wordmark {
  font-family: var(--font-display); font-weight: 750; font-stretch: 115%;
  text-decoration: none; margin-right: var(--space-sm); letter-spacing: -0.01em;
}
.nav-link {
  padding: 7px var(--space-sm); border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); text-decoration: none; white-space: nowrap;
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.nav-link:hover { color: var(--color-ink); background: var(--color-paper-2); }
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--color-paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- hero: split, copy left / instrument right ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: center;
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  min-height: min(calc(100dvh - 72px), 860px);
}
.hero-kicker { font-size: var(--text-sm); color: var(--color-ink-2); margin-bottom: var(--space-lg); }
.hero h1 {
  font-size: var(--text-display);
  font-weight: 780; font-stretch: 106%;
  line-height: 0.98; letter-spacing: -0.035em;
  margin-bottom: var(--space-lg);
}
.hero-sub { font-size: var(--text-lg); line-height: 1.5; color: var(--color-ink-2); max-width: 34ch; margin-bottom: var(--space-xl); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* the survey instrument */
.survey { min-width: 0; }
.survey-frame {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--radius-surface);
  overflow: hidden;
  background: var(--color-paper-2);
  box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule);
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.survey-map, .survey-gpu { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.survey-map[hidden], .survey-gpu[hidden] { display: none; }
.survey-cap {
  display: flex; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap;
  margin-top: var(--space-sm); font-size: var(--text-xs); color: var(--color-ink-2);
}

/* DOM lenses: CSS fallback look; become invisible handles when WebGPU renders real refraction */
.lens {
  position: absolute; left: 0; top: 0;
  cursor: grab; touch-action: none;
  background: var(--color-lens);
  -webkit-backdrop-filter: blur(1.5px) saturate(150%) contrast(1.15);
  backdrop-filter: blur(1.5px) saturate(150%) contrast(1.15);
  box-shadow:
    inset 0 1px 0 var(--color-glass-edge),
    inset 0 -1px 0 var(--color-glass-shade),
    inset 0 0 0 var(--rule-hair) var(--color-glass-shade),
    0 16px 34px -18px var(--color-glass-shade);
  will-change: transform;
}
.lens:active { cursor: grabbing; }
.lens-round { width: 132px; height: 132px; border-radius: 50%; }
.lens-pill { width: 196px; height: 78px; border-radius: var(--radius-pill); }
[data-survey].is-gpu .lens {
  background: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* ---------- sections ---------- */
.section-head { max-width: 62ch; margin-bottom: var(--space-2xl); }
.section-head h2 {
  font-size: var(--text-2xl); font-weight: 720; font-stretch: 108%;
  letter-spacing: -0.02em; line-height: 1.05; margin-bottom: var(--space-sm);
}
.section-head p { color: var(--color-ink-2); }

.work { padding-bottom: var(--space-4xl); }

.project h3 {
  font-size: var(--text-xl); font-weight: 720; font-stretch: 110%;
  letter-spacing: -0.02em; line-height: 1.1; margin-bottom: var(--space-sm);
}
.project p { color: var(--color-ink-2); }
.project-meta { font-size: var(--text-xs); color: var(--color-accent-ink) !important; margin-bottom: var(--space-xs); letter-spacing: 0.02em; }
.stack { font-size: var(--text-xs); margin-top: var(--space-md); line-height: 1.7; }

.demo {
  border-radius: var(--radius-surface);
  background: var(--color-paper-2);
  box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule);
  padding: var(--space-lg);
  min-width: 0;
}
.demo-note { font-size: var(--text-xs); color: var(--color-ink-2); margin-top: var(--space-md); }

/* Control260: text + panel */
.project-control {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-2xl);
  align-items: start;
  padding-top: var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.project-control h3 { font-size: var(--text-2xl); }
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md) var(--space-lg);
  margin-top: var(--space-lg);
}
.facts dt { font-size: var(--text-xs); color: var(--color-ink-2); }
.facts dd {
  font-family: var(--font-display); font-weight: 700; font-stretch: 115%;
  font-size: var(--text-xl); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.facts dd small { font-size: var(--text-sm); font-weight: 500; margin-left: 3px; color: var(--color-ink-2); }

.demo-head { display: flex; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-md); font-size: var(--text-sm); }
.demo-head p { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.demo-legend { color: var(--color-ink-2) !important; font-size: var(--text-xs); }
.key-pu, .key-ve { font-weight: 500; color: var(--color-ink); margin-left: var(--space-xs); }
.key-pu:first-child { margin-left: 0; }

.devices { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-xs); }
.device {
  width: 100%; aspect-ratio: 1 / 0.82;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: var(--space-xs);
  border-radius: 9px;
  background: var(--color-paper);
  box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule);
  font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1.2; text-align: left;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.device:active { transform: scale(0.96); }
.device .loc { color: var(--color-ink-2); }
.device .kind { font-weight: 500; }
.device .state {
  align-self: stretch; height: 3px; border-radius: 2px;
  background: var(--color-accent);
  transform-origin: left; transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.device[aria-pressed="false"] { background: transparent; color: var(--color-ink-2); }
.device[aria-pressed="false"] .state { background: var(--color-off); transform: scaleX(0.25); }
.device:hover { box-shadow: inset 0 0 0 var(--rule-hair) var(--color-ink-2); }

/* Absensi + Tracer diptych */
.diptych {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.diptych .demo { margin-bottom: var(--space-lg); }

.demo-geo { padding: 0; overflow: hidden; }
.geo-field {
  position: relative; aspect-ratio: 16 / 10; touch-action: none;
  background-image:
    linear-gradient(var(--color-rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-rule) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center;
}
.geo-ring {
  position: absolute; left: 50%; top: 50%;
  width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed var(--color-accent);
  background: color-mix(in oklch, var(--color-accent) 9%, transparent);
}
.geo-office {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: var(--text-xs); padding: 2px var(--space-xs); border-radius: var(--radius-pill);
  background: var(--color-paper); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule);
}
.geo-me {
  position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; cursor: grab; touch-action: none;
  background: var(--color-ink);
  box-shadow: 0 0 0 5px color-mix(in oklch, var(--color-ink) 18%, transparent);
  will-change: transform;
}
.geo-me:active { cursor: grabbing; }
.demo-geo.is-out .geo-ring { border-color: var(--color-ink-2); background: transparent; }
.geo-status {
  padding: var(--space-sm) var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule);
  font-size: var(--text-sm); color: var(--color-ink) !important; font-weight: 500;
}

.trace-svg { display: block; width: 100%; height: auto; }
.trace-raw circle { fill: var(--color-ink-2); opacity: 0.55; }
.trace-line { fill: none; stroke: var(--color-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trace-kept circle { fill: var(--color-paper); stroke: var(--color-accent); stroke-width: 2; }
.trace-svg .t-layer { transition: opacity var(--dur-slow) var(--ease-out); }
.trace-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin-top: var(--space-md); }
.trace-count { font-size: var(--text-xs); color: var(--color-ink-2); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule); background: var(--color-paper); }
.seg-btn {
  padding: 5px var(--space-md); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.seg-btn[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper); }

/* Smart-IFS: typographic index */
.project-ifs {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.ifs-modules { counter-reset: mod; display: grid; gap: 0; align-content: start; }
.ifs-modules li {
  counter-increment: mod;
  display: grid; grid-template-columns: 3ch minmax(0, 1fr); gap: var(--space-md); align-items: baseline;
  font-family: var(--font-display); font-weight: 560; font-stretch: 92%;
  font-size: clamp(1.25rem, 2.3vw, 1.875rem); line-height: 1.2; letter-spacing: -0.015em;
  padding: var(--space-sm) 0;
}
.ifs-modules li + li { border-top: var(--rule-hair) solid var(--color-rule); }
.ifs-modules li::before {
  content: counter(mod);
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent-ink); font-weight: 500;
}

/* Skills: layered cross-section, field at the bottom, screen on top */
.skills { padding-bottom: var(--space-4xl); }
.layers { display: flex; flex-direction: column-reverse; position: relative; padding-left: var(--space-xl); }
.layers::before {
  content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 2px;
  background: var(--color-accent);
}
.layer {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-lg);
  align-items: baseline;
  padding: var(--space-lg) 0;
  border-top: var(--rule-hair) solid var(--color-rule);
}
.layer:last-child { border-top: 0; }
.layer::before {
  content: ""; position: absolute; left: calc(-1 * var(--space-xl) + 2px); top: calc(var(--space-lg) + 0.45em);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--color-paper); box-shadow: inset 0 0 0 2px var(--color-accent);
}
.layer:first-child::before { background: var(--color-accent); }
.layer h3 { font-size: var(--text-lg); font-weight: 680; font-stretch: 108%; letter-spacing: -0.01em; }
.layer p { color: var(--color-ink-2); }

/* About + contact: letter-like close */
.about { padding-bottom: var(--space-3xl); }
.about-lead {
  font-family: var(--font-display); font-weight: 560; font-stretch: 100%;
  font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.25; letter-spacing: -0.02em;
  max-width: 30ch; margin-bottom: var(--space-lg);
}
.about-body { color: var(--color-ink-2); max-width: 56ch; }

.contact {
  padding-top: var(--space-2xl); padding-bottom: var(--space-4xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.contact h2 { font-size: var(--text-2xl); font-weight: 720; font-stretch: 108%; letter-spacing: -0.02em; line-height: 1.1; max-width: 22ch; margin-bottom: var(--space-sm); }
.contact > p { color: var(--color-ink-2); margin-bottom: var(--space-xl); }
.contact-mail {
  display: inline-block; max-width: 100%;
  font-family: var(--font-display); font-weight: 650; font-stretch: 105%;
  font-size: clamp(1.375rem, 4.4vw, 3.5rem); letter-spacing: -0.03em; line-height: 1.1;
  text-decoration: underline; text-decoration-color: var(--color-accent);
  text-decoration-thickness: 0.08em; text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
  transition: color var(--dur-base) var(--ease-out);
}
.contact-mail:hover { color: var(--color-accent-ink); }

.footer {
  display: flex; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap;
  padding-top: var(--space-lg); padding-bottom: var(--space-2xl);
  font-size: var(--text-sm); color: var(--color-ink-2);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--color-ink); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: var(--space-2xl); padding-bottom: var(--space-3xl); gap: var(--space-xl); }
  .project-control, .project-ifs, .diptych { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .diptych { gap: var(--space-3xl); }
}
@media (max-width: 640px) {
  .wrap { padding-inline: var(--space-md); }
  .nav-link { display: none; }
  .hero-sub { font-size: var(--text-base); }
  .hero-actions .btn { flex: 1 1 0; }
  .lens-round { width: 96px; height: 96px; }
  .lens-pill { width: 140px; height: 58px; }
  .devices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .demo { padding: var(--space-md); }
  .demo-geo { padding: 0; }
  .layer { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
  .facts dd { font-size: var(--text-lg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 120ms !important; animation: none !important; }
  .btn:active, .device:active { transform: none; }
}
