/* ============================================================
   XBTC — personal site
   Dark editorial / product & hardware portfolio
   ============================================================ */

:root {
  --bg: #07080a;
  --bg-2: #0b0d10;
  --panel: #101318;
  --panel-2: #14181e;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f4f5f7;
  --muted: #9aa3af;
  --muted-2: #6c7581;
  --accent: #ff5a5f;
  --accent-2: #ffb3b5;
  --accent-soft: rgba(255, 90, 95, 0.12);
  --on-accent: #0a0a0b;
  --hover-tint: rgba(255, 255, 255, 0.05);
  --radius: 20px;
  --radius-sm: 12px;
  --wrap: 1180px;
  --header-h: 76px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 日间模式：暖白纸感，红色作为唯一强调色 */
:root[data-theme="light"] {
  --bg: #f4f1eb;
  --bg-2: #ece7df;
  --panel: #fffdf9;
  --panel-2: #f8f4ed;
  --line: rgba(20, 22, 26, 0.1);
  --line-strong: rgba(20, 22, 26, 0.2);
  --text: #14161a;
  --muted: #5a6270;
  --muted-2: #8b929c;
  --accent: #df3742;
  --accent-2: #b8212c;
  --accent-soft: rgba(223, 55, 66, 0.1);
  --on-accent: #ffffff;
  --hover-tint: rgba(20, 22, 26, 0.05);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 82% -8%, rgba(255, 90, 95, 0.09), transparent 65%),
    radial-gradient(760px 520px at -8% 22%, rgba(120, 160, 255, 0.055), transparent 65%),
    linear-gradient(180deg, #07080a 0%, #07080a 100%);
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(620px 420px at 82% -8%, rgba(223, 55, 66, 0.08), transparent 65%),
    radial-gradient(760px 520px at -8% 22%, rgba(72, 108, 180, 0.055), transparent 65%),
    linear-gradient(180deg, #f4f1eb 0%, #f4f1eb 100%);
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 48px, var(--wrap));
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

h1, h2, h3, h4, p { margin-top: 0; }

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

section[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: 18px; }

/* ---------- header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(7, 8, 10, 0.82);
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-weight: 750;
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.brand-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}

.nav a:hover,
.nav a.is-active { color: var(--text); }

.nav a:hover::after,
.nav a.is-active::after { width: 100%; }

.header-cta { flex: 0 0 auto; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  flex: 0 0 auto;
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.theme-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--hover-tint);
}

.theme-btn svg {
  width: 17px;
  height: 17px;
  display: block;
}

.theme-btn .icon-moon { display: none; }

:root[data-theme="light"] .theme-btn .icon-sun { display: none; }
:root[data-theme="light"] .theme-btn .icon-moon { display: block; }

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 17px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover { background: #ff7075; }

:root[data-theme="light"] .btn-primary:hover { background: #c92c36; }

.btn-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--text); background: var(--hover-tint); }

.btn-small {
  height: 38px;
  padding: 0 17px;
  font-size: 0.82rem;
}

.btn-block { width: 100%; }

.arrow { font-size: 0.9em; opacity: 0.75; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  transition: color 0.2s var(--ease);
}

.text-link:hover { color: var(--accent-2); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--header-h) + 74px) 0 96px;
  overflow: hidden;
}

.grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(ellipse at 55% 28%, #000 12%, transparent 72%);
  mask-image: radial-gradient(ellipse at 55% 28%, #000 12%, transparent 72%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 56px;
  align-items: center;
}

.hero-copy h1 {
  margin-bottom: 26px;
  font-size: clamp(3rem, 6.6vw, 6.1rem);
  line-height: 0.98;
}

.hero-copy h1 .serif { color: var(--accent-2); }

.hero-lede {
  max-width: 32em;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 30px 46px;
  margin: 46px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-meta dt {
  margin-bottom: 5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-meta dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-visual {
  position: relative;
  min-height: 590px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone {
  position: relative;
  width: 268px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 40px;
  background: linear-gradient(160deg, #1a1e24, #0c0e11);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.phone::after {
  content: "";
  position: absolute;
  top: 17px;
  left: 50%;
  z-index: 2;
  width: 84px;
  height: 22px;
  border-radius: 999px;
  background: #08090b;
  transform: translateX(-50%);
}

.phone img {
  width: 100%;
  border-radius: 32px;
}

.phone-main {
  z-index: 2;
  transform: rotate(-3.5deg);
}

.phone-back {
  position: absolute;
  top: 22px;
  right: -24px;
  width: 224px;
  opacity: 0.52;
  transform: rotate(6deg);
  filter: saturate(0.85);
}

.float-card {
  position: absolute;
  left: -18px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 236px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 19, 24, 0.9);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.float-card img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
}

.float-card div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.float-card .mono { color: var(--accent-2); font-size: 0.56rem; }
.float-card strong { font-size: 0.88rem; letter-spacing: 0.01em; }
.float-card small { color: var(--muted-2); font-size: 0.68rem; }

/* ---------- sections ---------- */

.section { padding: 100px 0; }

.section-soft {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 60%);
}

.section-head { margin-bottom: 44px; }

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-head-row h2 { margin-bottom: 0; }

.section-head > p:not(.eyebrow) {
  max-width: 42em;
  margin: 12px 0 0;
  color: var(--muted);
}

/* ---------- work cards ---------- */

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 24px;
}

.work-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.work-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.work-media {
  position: relative;
  height: 330px;
  overflow: hidden;
  background: #0a0c0f;
}

.work-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(7, 8, 10, 0.55));
  pointer-events: none;
}

.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.7s var(--ease);
}

.work-card:hover .work-media img { transform: scale(1.035); }

.work-card:nth-child(2) .work-media img { object-position: center; }

.work-media--phone {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(380px 240px at 50% 58%, rgba(255, 90, 95, 0.16), transparent 72%),
    linear-gradient(180deg, #12161c, #090b0e);
}

.work-media--phone::after { display: none; }

.work-media--phone img {
  width: auto;
  height: 86%;
  max-width: 70%;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  object-fit: contain;
  object-position: center;
}

.work-card:hover .work-media--phone img { transform: none; }

.work-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 26px 26px 28px;
}

.work-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 90, 95, 0.3);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.work-body h3 { margin-bottom: 10px; font-size: 1.55rem; }

.work-body p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

.tags span {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
}

.work-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.work-link span { color: var(--accent); }

/* ---------- capabilities ---------- */

.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.cap {
  padding: 34px 30px 8px 0;
  border-right: 1px solid var(--line);
}

.cap:last-child { border-right: 0; padding-right: 0; }

.cap .num {
  display: block;
  margin-bottom: 40px;
  color: var(--accent);
  font-size: 0.66rem;
}

.cap h3 { margin-bottom: 10px; font-size: 1.2rem; }
.cap p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.8; }

/* ---------- now ---------- */

.now-grid {
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 60px;
}

.now-grid h2 { margin-bottom: 12px; }
.now-grid .muted { font-size: 0.88rem; }

.now-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

.now-list li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.now-list div { display: flex; flex-direction: column; gap: 3px; }
.now-list strong { font-size: 0.98rem; font-weight: 600; }
.now-list div span { color: var(--muted-2); font-size: 0.8rem; }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 60px;
}

.about-copy p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.95;
}

.about-copy p:last-of-type { margin-bottom: 28px; }

.toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbox span {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

/* ---------- CTA ---------- */

.cta-section {
  padding: 110px 0;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(700px 320px at 50% 0%, rgba(255, 90, 95, 0.1), transparent 70%),
    var(--bg-2);
  text-align: center;
}

.cta-inner h2 { font-size: clamp(2.4rem, 5vw, 4.4rem); margin-bottom: 14px; }
.cta-inner h2 .serif { color: var(--accent-2); }
.cta-inner p:not(.eyebrow) { margin-bottom: 28px; color: var(--muted); }

/* ---------- footer ---------- */

.site-footer {
  padding: 52px 0 44px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 1fr;
  gap: 40px;
  align-items: start;
}

.footer-grid > div:first-child p {
  margin: 16px 0 0;
  font-size: 0.84rem;
}

.footer-grid nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer-grid nav a:hover { color: var(--text); }

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: var(--muted-2);
  font-size: 0.76rem;
}

.footer-meta a:hover { color: var(--text); }
.footer-meta .icp { font-size: 0.66rem; letter-spacing: 0.02em; }
.footer-meta .police { display: inline-flex; align-items: center; gap: 5px; }
.footer-meta .police img { width: 16px; height: 17px; object-fit: contain; }

/* ---------- work page ---------- */

.page-hero {
  padding: calc(var(--header-h) + 84px) 0 70px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 { margin-bottom: 20px; font-size: clamp(2.8rem, 6vw, 5rem); }
.page-hero p { max-width: 40em; margin: 0; color: var(--muted); font-size: 1rem; }

.project {
  padding: 90px 0;
  border-bottom: 1px solid var(--line);
}

.project-head {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 260px;
  gap: 30px;
  align-items: start;
  margin-bottom: 48px;
}

.project-index {
  padding-top: 6px;
  color: var(--accent);
  font-size: 0.72rem;
}

.project-head h2 { margin-bottom: 14px; font-size: clamp(2rem, 4vw, 3.2rem); }

.project-lede { max-width: 38em; margin: 0; color: var(--muted); line-height: 1.85; }

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.project-meta span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-meta strong { font-size: 0.82rem; font-weight: 500; }

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 54px;
}

.shots figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.shots img {
  width: 100%;
  aspect-ratio: 720 / 1520;
  object-fit: cover;
  object-position: top center;
}

.shots figcaption {
  padding: 12px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.project-body {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.project-body h3 { margin-bottom: 18px; font-size: 1.05rem; }

.check-list { margin: 0; padding: 0; list-style: none; }

.check-list li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.project-showcase {
  overflow: hidden;
  margin-bottom: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.project-showcase img { width: 100%; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 48px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.spec-grid > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 22px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec-grid strong { font-size: 0.92rem; font-weight: 600; }
.spec-grid span { color: var(--muted-2); font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; }

.note {
  margin: 26px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.lab-grid > div {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.lab-grid .mono { color: var(--accent); font-size: 0.6rem; }
.lab-grid h3 { margin: 20px 0 8px; font-size: 1.02rem; }
.lab-grid p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.75; }

/* ---------- contact ---------- */

.contact-section { padding: calc(var(--header-h) + 76px) 0 100px; }

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
  align-items: start;
}

.contact-copy h1 {
  margin-bottom: 24px;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 0.98;
}

.contact-copy h1 .serif { color: var(--accent-2); }

.contact-copy > p {
  max-width: 30em;
  margin-bottom: 26px;
  color: var(--muted);
  line-height: 1.9;
}

.contact-notes { margin: 0; padding: 0; list-style: none; }

.contact-notes li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.contact-notes .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.contact-direct {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.contact-direct-label {
  color: var(--muted-2);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.contact-direct a {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.contact-direct a:hover { color: var(--accent); }

.contact-form {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.field label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field .optional { color: var(--muted-2); text-transform: none; letter-spacing: 0; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0e12;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.field textarea { resize: vertical; min-height: 132px; }

.field input::placeholder,
.field textarea::placeholder { color: #5c6672; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(255, 90, 95, 0.5);
  background: #0d1116;
  outline: none;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 0.82rem;
  text-align: center;
}

.form-status.ok { color: #5eead4; }
.form-status.err { color: #ff8a8f; }

/* ---------- light theme component overrides ---------- */

:root[data-theme="light"] .site-header.is-scrolled {
  background: rgba(244, 241, 235, 0.86);
}

:root[data-theme="light"] .section-soft {
  background: linear-gradient(180deg, rgba(20, 22, 26, 0.018), transparent 60%);
}

:root[data-theme="light"] .cta-section {
  background:
    radial-gradient(700px 320px at 50% 0%, rgba(223, 55, 66, 0.09), transparent 70%),
    var(--bg-2);
}

:root[data-theme="light"] .phone {
  box-shadow: 0 30px 80px rgba(20, 22, 26, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] .float-card {
  background: rgba(255, 253, 249, 0.92);
  box-shadow: 0 24px 60px rgba(20, 22, 26, 0.14);
}

:root[data-theme="light"] .work-media::after {
  background: linear-gradient(180deg, transparent 62%, rgba(244, 241, 235, 0.32));
}

:root[data-theme="light"] .work-media--phone {
  background:
    radial-gradient(380px 240px at 50% 58%, rgba(223, 55, 66, 0.12), transparent 72%),
    linear-gradient(180deg, #fff8f4, #f2ece5);
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .field textarea {
  background: #fffdf9;
}

:root[data-theme="light"] .field input::placeholder,
:root[data-theme="light"] .field textarea::placeholder {
  color: #9aa1ab;
}

:root[data-theme="light"] .field input:focus,
:root[data-theme="light"] .field select:focus,
:root[data-theme="light"] .field textarea:focus {
  background: #ffffff;
}

:root[data-theme="light"] .form-status.ok { color: #0f766e; }
:root[data-theme="light"] .form-status.err { color: #b91c1c; }

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 1;
  transform: translateY(14px);
  transition: transform 0.7s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { min-height: 520px; margin-top: 10px; }
  .work-grid { grid-template-columns: 1fr; }
  .work-media { height: 360px; }
  .cap-grid { grid-template-columns: 1fr 1fr; }
  .cap:nth-child(2) { border-right: 0; }
  .cap:nth-child(3) { padding-top: 34px; border-top: 1px solid var(--line); }
  .now-grid,
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .project-head { grid-template-columns: 50px 1fr; }
  .project-meta { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 10px 26px; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .project-meta span { display: none; }
  .project-body { grid-template-columns: 1fr; gap: 30px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-meta { align-items: flex-start; grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 14px; }
}

@media (max-width: 760px) {
  :root { --header-h: 68px; }
  .wrap { width: calc(100% - 36px); }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 18px;
    right: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(10, 12, 15, 0.97);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 12px; border-radius: 9px; font-size: 0.92rem; }
  .nav a:hover { background: rgba(255, 255, 255, 0.05); }
  .nav a::after { display: none; }
  :root[data-theme="light"] .nav {
    background: rgba(250, 247, 242, 0.98);
    box-shadow: 0 24px 60px rgba(20, 22, 26, 0.18);
  }
  :root[data-theme="light"] .nav a:hover { background: rgba(20, 22, 26, 0.05); }
  .header-tools { margin-left: auto; }
  .header-cta { display: none; }
  .menu-btn { display: block; }
  .hero { padding-top: calc(var(--header-h) + 54px); padding-bottom: 64px; }
  .hero-copy h1 { font-size: clamp(2.7rem, 14vw, 4rem); }
  .hero-visual { min-height: 0; padding: 24px 0 30px; }
  .phone { width: 232px; }
  .phone-back { width: 190px; right: -6px; top: 4px; opacity: 0.4; }
  .float-card { left: 0; bottom: 0; width: 216px; }
  .section { padding: 68px 0; }
  .section-head-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .work-media { height: 280px; }
  .cap-grid { grid-template-columns: 1fr; }
  .cap { padding: 26px 0 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cap:last-child { border-bottom: 0; }
  .cap .num { margin-bottom: 22px; }
  .now-list li { grid-template-columns: 14px 1fr; gap: 14px; }
  .now-list li > .mono { grid-column: 2; }
  .page-hero { padding-top: calc(var(--header-h) + 60px); padding-bottom: 48px; }
  .project { padding: 64px 0; }
  .project-head { grid-template-columns: 1fr; gap: 14px; }
  .project-index { padding: 0; }
  .project-meta { grid-column: 1; }
  .shots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
  .shots figure { flex: 0 0 68%; scroll-snap-align: start; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .lab-grid { grid-template-columns: 1fr; }
  .contact-section { padding-top: calc(var(--header-h) + 54px); }
  .contact-form { padding: 22px; }
  .cta-section { padding: 76px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-meta { grid-column: auto; }
}

@media (max-width: 420px) {
  .phone { width: 210px; }
  .phone-back { display: none; }
  .float-card { left: auto; right: 0; bottom: -6px; }
  .hero-actions .btn { width: 100%; }
  .hero-meta { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}