:root {
  /* Colors */
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #101624;
  --muted: #617089;
  --line: #dbe4ef;
  --blue: #3f63ff;
  --cyan: #17b4d8;
  --green: #31bd75;
  --violet: #6c5ce7;
  --peach: #ff775d;
  --gold: #d9902d;

  /* Layout & Effects */
  --shadow: 0 24px 72px rgba(32, 45, 71, 0.12);

  /* Typography */
  --font-sans: "Huang Noto CJK", "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", "Source Han Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Hero Typography */
  --hero-title-size: 76px;
  --hero-title-weight: 850;
  --hero-tagline-size: 28px;
  --hero-tagline-weight: 760;
  --hero-lede-size: 18px;
  --hero-panel-height: 430px;
  --hero-panel-title-size: 22px;
  --hero-panel-title-weight: 780;
  --hero-panel-body-size: 14px;
  --hero-app-name-size: 14px;
  --hero-app-desc-size: 12px;
  --hero-signal-size: 18px;
  --hero-mobile-title-size: 54px;
  --hero-mobile-tagline-size: 22px;

  /* Motion */
  --motion-fast: 170ms;
  --motion-med: 280ms;
  --motion-slow: 640ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --hover-border: rgba(63, 99, 255, 0.42);
  --hover-shadow: 0 16px 42px rgba(32, 48, 82, 0.13);
}

[data-theme="dark"] {
  --bg: #0d1320;
  --surface: #131b2a;
  --surface-soft: #172133;
  --ink: #e9eef8;
  --muted: #9ba8bc;
  --line: #29364b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --hover-border: rgba(93, 125, 255, 0.58);
  --hover-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 5%, rgba(69, 103, 255, 0.1), transparent 28%),
    radial-gradient(circle at 8% 20%, rgba(24, 185, 232, 0.12), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.load-error {
  margin: 0;
  padding: 12px 18px;
  background: #fff1f0;
  color: #9f1d16;
  font-weight: 700;
}

.page-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 24px auto;
  border: 1px solid rgba(197, 211, 232, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  overflow: hidden;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 74px;
  padding: 0 48px;
  border-bottom: 1px solid rgba(223, 231, 244, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 52px;
  font-size: 15px;
  font-weight: 720;
}

.nav a {
  min-width: 72px;
  text-align: center;
}

.header-tools {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.header-tools button {
  min-width: 42px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(480px, 1.15fr);
  align-items: center;
  min-height: 640px;
  overflow: hidden;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.96) 37%, rgba(255, 255, 255, 0.24) 65%, transparent 100%);
  content: "";
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 72px 0 64px 64px;
}

.status,
.phone-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #30394d;
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 8px 24px rgba(47, 74, 130, 0.08);
  min-height: 38px;
  white-space: nowrap;
}

.status span,
.phone-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.hero h1 {
  max-width: 720px;
  min-height: 1.95em;
  margin: 0;
  font-size: clamp(56px, 5.4vw, 96px);
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: keep-all;
}

.hero h1 strong {
  color: var(--blue);
}

.hero-title-prefix {
  display: inline-block;
  white-space: nowrap;
}

.hero-title-emoji {
  display: inline-block;
  font-size: 0.62em;
}

.tagline {
  max-width: 640px;
  min-height: 1.3em;
  margin: 30px 0 0;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.3;
  font-weight: 720;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.lede {
  max-width: 520px;
  min-height: 4.65em;
  margin: 26px 0 0;
  color: #344056;
  font-size: 20px;
  line-height: 1.55;
  font-weight: 500;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.hero-actions {
  display: flex;
  gap: 18px;
  min-height: 54px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 820;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}


.button.primary {
  background: linear-gradient(135deg, var(--blue), #617cff);
  color: #fff;
  box-shadow: 0 16px 32px rgba(69, 103, 255, 0.26);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.button.secondary span {
  color: var(--blue);
  font-family: var(--font-mono);
}

.tech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 84px;
  margin-top: 72px;
}

.tech-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #25314a;
  font-size: 13px;
  font-weight: 750;
}

.tech-strip span::before {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.swift::before {
  background: #ff6a3d;
  content: "S";
}

.swiftui::before {
  background: #2ca9ff;
  content: "S";
}

.nextjs::before {
  background: #111;
  content: "N";
}

.local-ai::before {
  background: #2ead5a;
  content: "AI";
}

.automation::before {
  background: var(--violet);
  content: "⚙";
}

.hero-art {
  position: absolute;
  inset: 0 0 auto auto;
  width: 70%;
  height: 100%;
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

.section {
  padding: 64px 64px;
  border-top: 1px solid rgba(223, 231, 244, 0.9);
}

/* Section heights removed to allow fluid layouts */

.section-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.section-top h2 {
  min-height: 1.1em;
  margin: 0 0 10px;
  font-size: clamp(28px, 2.4vw, 40px);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-top p {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.section-top a {
  min-width: 136px;
  text-align: right;
  color: var(--blue);
  font-size: 15px;
  font-weight: 760;
  white-space: nowrap;
}

.apps-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 48px;
  align-items: start;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.app-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 30px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 45px rgba(52, 72, 112, 0.08);
}

.app-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(47, 74, 130, 0.16);
}

.app-icon-image {
  display: block;
  object-fit: cover;
}

.app-icon.screenshot {
  background:
    linear-gradient(#fff, #fff) center 52% / 36px 24px no-repeat,
    linear-gradient(135deg, #12b5ff, var(--blue));
}

.app-icon.fit {
  background: #fff1ee;
}

.app-icon.fit::before {
  width: 44px;
  height: 44px;
  border: 8px solid #ff6d5f;
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px #18c3cf;
  content: "";
}

.app-icon.studio {
  background: #07101e;
  color: var(--cyan);
  font-size: 28px;
  font-weight: 900;
}

.app-icon.sumiyomi {
  background:
    radial-gradient(circle at 62% 28%, rgba(255, 255, 255, 0.96) 0 14px, transparent 15px),
    linear-gradient(135deg, #111827, #4567ff 58%, #18b9e8);
  color: #fff;
}

.app-icon.sumiyomi::before {
  content: "墨";
  font-size: 28px;
  font-weight: 900;
}

.app-card h3,
.mini-project h3,
.blog h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
}

.app-card h3 {
  margin: 0;
  min-height: 2.24em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.app-card p {
  min-height: 92px;
  max-height: 92px;
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 520;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.app-card .store-button,
.app-card .quiet-button {
  margin-top: auto;
}

.store-button,
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-button {
  background: #080d15;
  color: #fff;
}

.quiet-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.coming-soon {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border-style: dashed;
  text-align: center;
}

.plus {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border: 1px dashed #b7c5dd;
  border-radius: 50%;
  color: #6d7890;
  font-size: 36px;
  font-weight: 300;
}

.phone-preview {
  position: sticky;
  top: 24px;
  padding: 18px;
  border: 9px solid #0a0f18;
  border-radius: 38px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 28, 48, 0.18);
}

.phone-top,
.phone-nav {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 750;
}

.phone-nav {
  margin: 22px 0;
  font-size: 16px;
}

.phone-status {
  margin-bottom: 18px;
  font-size: 10px;
}

.phone-preview h3 {
  min-height: 32px;
  max-height: 32px;
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.05;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.phone-preview h3 strong {
  color: var(--blue);
}

.phone-preview p {
  color: #44506a;
  font-size: 14px;
  line-height: 1.45;
}

.phone-preview a {
  display: flex;
  justify-content: center;
  margin: 18px 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.phone-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  object-position: right center;
  border-radius: 8px;
}

.phone-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.phone-list span {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #26314a;
  font-size: 13px;
  font-weight: 760;
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1.2fr) repeat(3, minmax(180px, 1fr));
  gap: 24px;
}

.terminal {
  min-height: 260px;
  padding: 22px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 10%, rgba(24, 185, 232, 0.13), transparent 38%),
    #08101b;
  color: #b8f575;
  font-family: var(--font-mono);
  box-shadow: 0 18px 42px rgba(8, 16, 27, 0.18);
}

.terminal-head {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.terminal-head span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff6d5f;
}

.terminal-head span:nth-child(2) {
  background: #f6cf47;
}

.terminal-head span:nth-child(3) {
  background: #38c66b;
}

.terminal pre {
  margin: 0;
  color: #dce8f7;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.mini-project,
.blog article,
.stack-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.mini-project {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 22px;
}

.mini-project h3 {
  margin: 0 0 10px;
  min-height: 2.24em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mini-project p {
  min-height: 63px;
  max-height: 63px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.mini-project span,
.stack-grid span {
  display: inline-flex;
  margin-top: 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.chart,
.swirl,
.route {
  height: 88px;
  margin-bottom: 22px;
  border-radius: 8px;
}

.chart {
  background:
    linear-gradient(135deg, transparent 0 40%, rgba(69, 103, 255, 0.18) 40% 60%, transparent 60%),
    linear-gradient(90deg, #dbe8ff, #fff);
}

.swirl {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 18px, #7564e8 19px 28px, transparent 29px),
    radial-gradient(circle at 56% 42%, transparent 0 18px, #18b9e8 19px 24px, transparent 25px),
    #fbfbff;
}

.route {
  background:
    linear-gradient(135deg, rgba(24, 185, 232, 0.25), rgba(69, 103, 255, 0.08)),
    repeating-linear-gradient(45deg, #edf3fb 0 12px, #fff 12px 24px);
}

.about {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}

.avatar {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(47, 74, 130, 0.14);
}

.about-copy h2 {
  margin: 0 0 18px;
  font-size: 36px;
}

.about-copy p {
  max-width: 760px;
  margin: 0 0 14px;
  color: #40506b;
  font-size: 16px;
  line-height: 1.8;
}

.focus-row {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.focus-row span {
  display: grid;
  place-items: center;
  min-width: 92px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #25314a;
  font-size: 14px;
  font-weight: 760;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.stack-grid article {
  min-height: 166px;
  padding: 24px;
}

.stack-grid strong {
  display: block;
  margin-bottom: 18px;
  font-size: 20px;
}

.stack-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.blog article {
  overflow: hidden;
}

.blog-image {
  height: 160px;
}

.blog-image.desk {
  background:
    linear-gradient(rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.02)),
    url("assets/huang/hero-illustration.jpg") center / cover;
}

.blog-image.spring {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(69, 103, 255, 0.1)),
    linear-gradient(150deg, #d9efff 0%, #fff 42%, #ffdfe8 100%);
}

.blog-image.night {
  background:
    radial-gradient(circle at 70% 24%, #ffcf70 0 4px, transparent 5px),
    linear-gradient(145deg, #111d3f, #3340a0 48%, #0c1127);
}

.blog time {
  display: block;
  margin: 18px 20px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.blog h3,
.blog p {
  margin-right: 20px;
  margin-left: 20px;
}

.blog h3 {
  font-size: 19px;
}

.blog p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.newsletter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 540px);
  gap: 30px;
  align-items: center;
  min-height: 116px;
  margin: 12px 64px 34px;
  padding: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(69, 103, 255, 0.14), rgba(255, 255, 255, 0.8));
}

.newsletter strong {
  display: block;
  min-height: 1.25em;
  font-size: 22px;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.newsletter p {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.newsletter form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 12px;
}

.newsletter input,
.newsletter button {
  min-height: 52px;
  border-radius: 8px;
}

.newsletter input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 18px;
  background: #fff;
}

.newsletter button {
  border: 0;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 0 64px 36px;
  color: var(--muted);
  font-size: 14px;
}

.footer-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.footer nav {
  display: flex;
  gap: 30px;
}

.icp-link {
  color: inherit;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    position: relative;
    z-index: 2;
    width: calc(100% - 96px);
    height: 460px;
    margin: 0 48px 48px;
    border-radius: 8px;
    overflow: hidden;
  }

  .hero::before {
    background: linear-gradient(#fff 0%, rgba(255, 255, 255, 0.92) 58%, transparent 100%);
  }

  .apps-layout {
    grid-template-columns: 1fr;
  }

  .phone-preview {
    display: none;
  }

  .app-grid,
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lab-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: 100%;
    margin: 0;
    border-width: 0;
    border-radius: 0;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 66px;
    padding: 0 18px;
  }

  .nav {
    display: none;
  }

  .header-tools {
    gap: 6px;
  }

  .lang-switcher button {
    min-width: 30px;
    height: 32px;
    padding: 0 7px;
    font-size: 12px;
  }

  .brand {
    font-size: 17px;
  }

  .hero-copy {
    padding: 42px 18px 28px;
  }

  .hero {
    min-height: auto;
  }

  .status {
    margin-bottom: 26px;
    font-size: 12px;
  }

  .hero h1 {
    font-size: clamp(46px, 15vw, 66px);
  }

  .tagline {
    font-size: 20px;
  }

  .lede {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .tech-strip {
    margin-top: 34px;
  }

  .hero-art {
    width: calc(100% - 36px);
    height: 290px;
    margin: 0 18px 32px;
  }

  .hero-art img {
    object-position: right center;
  }

  .section {
    padding: 46px 18px;
  }

  .apps {
    min-height: auto;
  }

  .lab {
    min-height: auto;
  }

  .about {
    min-height: auto;
  }

  .stack {
    min-height: auto;
  }

  .blog {
    min-height: auto;
  }

  .section-top {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 24px;
  }

  .app-grid,
  .lab-layout,
  .stack-grid,
  .blog-grid,
  .newsletter {
    grid-template-columns: 1fr;
  }

  .app-card {
    min-height: auto;
  }

  .app-card p {
    min-height: auto;
  }

  .app-card h3 {
    min-height: auto;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .focus-row {
    grid-column: auto;
  }

  .focus-row span {
    min-width: calc(50% - 9px);
  }

  .newsletter {
    margin: 0 18px 28px;
  }

  .newsletter form {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    padding: 0 18px 32px;
  }
}

/* Skip link (a11y) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  transition: top 150ms ease;
}

.skip-link:focus {
  top: 12px;
}

/* Graceful page load: prevent content flash */
body.is-loading .page-shell {
  opacity: 0;
}

body.is-loaded .page-shell {
  animation: page-fade-in 0.35s ease forwards;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body.is-loaded .page-shell {
    animation: none;
    opacity: 1;
  }
}

/* Focus rings (a11y): only show for keyboard users via :focus-visible.
   Mouse / touch users get no ring, preserving the clean aesthetic. */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Elements with their own border-radius — outline follows their shape
   automatically in modern browsers. */
.button:focus-visible,
.app-card:focus-visible,
.mini-project:focus-visible,
.blog article a:focus-visible,
.lang-switcher button:focus-visible,
.header-tools button:focus-visible,
.newsletter button:focus-visible,
.newsletter input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Suppress the legacy :focus outline for mouse clicks. Modern browsers
   already do this when :focus-visible is available, but being explicit
   prevents inconsistency in older versions. */
:focus:not(:focus-visible) {
  outline: none;
}

/* Dark mode: --blue at 0.4 luminance can lose contrast on dark surfaces,
   so use the brighter --cyan for the focus ring. */
[data-theme="dark"] :focus-visible,
[data-theme="dark"] .button:focus-visible,
[data-theme="dark"] .app-card:focus-visible,
[data-theme="dark"] .mini-project:focus-visible,
[data-theme="dark"] .blog article a:focus-visible,
[data-theme="dark"] .lang-switcher button:focus-visible,
[data-theme="dark"] .header-tools button:focus-visible,
[data-theme="dark"] .newsletter button:focus-visible,
[data-theme="dark"] .newsletter input:focus-visible {
  outline-color: var(--cyan);
}

/* Newsletter inline status */
.newsletter-status {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

/* Language switcher (segmented control in header) */
.lang-switcher {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.lang-switcher button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}


.lang-switcher button:hover {
  color: var(--ink);
}

.lang-switcher button.is-active {
  background: var(--blue);
  color: #fff;
}

/* The standalone theme button keeps its border; switcher already has its own */
.header-tools .lang-switcher + button {
  margin-left: 2px;
}



[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% 5%, rgba(69, 103, 255, 0.22), transparent 28%),
    radial-gradient(circle at 8% 20%, rgba(24, 185, 232, 0.18), transparent 28%),
    var(--bg);
}

[data-theme="dark"] .page-shell {
  background: rgba(19, 26, 43, 0.78);
  border-color: rgba(50, 60, 86, 0.7);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 16, 32, 0.72);
  border-color: rgba(50, 60, 86, 0.7);
}

[data-theme="dark"] .hero::before {
  background: linear-gradient(90deg, #0b1020 0%, rgba(11, 16, 32, 0.96) 37%, rgba(11, 16, 32, 0.4) 65%, transparent 100%);
}

[data-theme="dark"] .status,
[data-theme="dark"] .phone-status,
[data-theme="dark"] .tech-strip span,
[data-theme="dark"] .button.secondary,
[data-theme="dark"] .app-card,
[data-theme="dark"] .mini-project,
[data-theme="dark"] .blog article,
[data-theme="dark"] .stack-grid article,
[data-theme="dark"] .focus-row span,
[data-theme="dark"] .header-tools button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

[data-theme="dark"] .status,
[data-theme="dark"] .phone-status {
  color: #cdd6e8;
}

[data-theme="dark"] .tech-strip span,
[data-theme="dark"] .phone-list span,
[data-theme="dark"] .focus-row span {
  color: #d7dff0;
}

[data-theme="dark"] .lede,
[data-theme="dark"] .about-copy p {
  color: #b7c1d6;
}

[data-theme="dark"] .quiet-button {
  background: #1b2338;
  color: var(--ink);
}

[data-theme="dark"] .phone-preview {
  background: #1a2238;
  border-color: #1f2942;
}

[data-theme="dark"] .phone-preview p {
  color: #b7c1d6;
}

[data-theme="dark"] .phone-list span {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .newsletter {
  background: linear-gradient(135deg, rgba(69, 103, 255, 0.22), rgba(19, 26, 43, 0.7));
}

[data-theme="dark"] .newsletter input {
  background: #1b2338;
  color: var(--ink);
}

[data-theme="dark"] .nextjs::before {
  background: #f7fafc;
  color: #111;
}

[data-theme="dark"] .lang-switcher {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

[data-theme="dark"] .lang-switcher button {
  color: var(--muted);
}


[data-theme="dark"] .lang-switcher button:hover {
  color: var(--ink);
}

[data-theme="dark"] .lang-switcher button.is-active {
  background: var(--blue);
  color: #fff;
}

/* ---------- i18n layout stability ---------- */

/* Balanced headline wrapping (no orphans) */
.hero h1,
.section-top h2,
.app-card h3,
.mini-project h3,
.blog h3,
.about-copy h2,
.newsletter strong {
  text-wrap: balance;
}

/* Reserve space for the longest translation (usually JP) so cards don't jump
   when the user switches language. min-height — not fixed — so future content
   can still grow. */
.lede {
  min-height: 93px;
}

.mini-project p {
  min-height: 63px;
}

.blog h3 {
  min-height: 46px;
}

.blog p {
  min-height: 63px;
}

/* ---------- Theme switch transitions (no flash) ---------- */

body,
.page-shell,
.site-header,
.app-card,
.mini-project,
.stack-grid article,
.blog article,
.focus-row span,
.tech-strip span,
.phone-preview,
.phone-list span,
.phone-preview p,
.header-tools button,
.lang-switcher,
.lang-switcher button,
.status,
.phone-status,
.button.secondary,
.newsletter,
.newsletter input,
.quiet-button {
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease;
}

/* ---------- Terminal: syntax colors + blinking cursor ---------- */

.terminal .t-prompt {
  color: #38c66b;
}

.terminal .t-cmd {
  color: #ffe7b3;
  font-weight: 700;
}

.terminal .t-bullet {
  color: #18b9e8;
}

.terminal .t-name {
  color: #ffffff;
  font-weight: 700;
}

.terminal .t-out {
  color: #aec0d6;
}

.terminal .t-cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  margin-left: 4px;
  background: #b8f575;
  vertical-align: -2px;
  animation: terminal-blink 1.05s steps(1) infinite;
}

@keyframes terminal-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
  will-change: opacity, transform;
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced-motion users for both reveal + cursor + decorative anim */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .terminal .t-cursor {
    animation: none;
    opacity: 1;
  }
  body,
  .page-shell,
  .site-header,
  .app-card,
  .mini-project,
  .stack-grid article,
  .blog article,
  .focus-row span,
  .tech-strip span,
  .phone-preview,
  .phone-list span,
  .phone-preview p,
  .header-tools button,
  .lang-switcher,
  .lang-switcher button,
  .status,
  .phone-status,
  .button.secondary,
  .newsletter,
  .newsletter input,
  .quiet-button {
    transition: none;
  }
}

/* ---------- Product Design refresh ---------- */

@font-face {
  font-family: "Huang Noto CJK";
  src: url("assets/fonts/noto-sans-cjk-sc/NotoSansCJKsc-Regular.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 500;
}

@font-face {
  font-family: "Huang Noto CJK";
  src: url("assets/fonts/noto-sans-cjk-sc/NotoSansCJKsc-Bold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 600 900;
}



body {
  background-color: var(--bg);
}

.page-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 90px rgba(39, 55, 84, 0.13);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 20px;
  letter-spacing: 0;
}

.brand-glyph {
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--blue);
  font-size: 23px;
}

.nav {
  gap: 44px;
  font-size: 14px;
  font-weight: 700;
}

.nav a {
  min-width: 64px;
}

.header-tools button,
.lang-switcher button {
  font-weight: 700;
}

.hero {
  grid-template-columns: minmax(520px, 0.92fr) minmax(360px, 0.58fr);
  align-items: end;
  min-height: 690px;
  background: #ffffff;
}

.hero::before {
  background:
    linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.98) 32%, rgba(255, 255, 255, 0.68) 54%, rgba(255, 255, 255, 0.1) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 76%, rgba(255, 255, 255, 0.9) 100%);
}

.hero-copy {
  max-width: 710px;
  padding: 78px 0 56px 72px;
}

.status,
.phone-status {
  margin-bottom: 30px;
  padding: 8px 13px;
  color: #334158;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.hero h1 {
  max-width: 690px;
  min-height: 154px;
  font-size: var(--hero-title-size);
  line-height: 0.98;
  font-weight: var(--hero-title-weight);
  letter-spacing: 0;
}

.hero h1 strong {
  color: var(--blue);
}

.hero-title-prefix {
  white-space: nowrap;
}

.hero-title-emoji {
  font-size: 0.54em;
  vertical-align: 0.08em;
}

.tagline {
  max-width: 650px;
  min-height: 37px;
  margin-top: 28px;
  color: #101624;
  font-size: var(--hero-tagline-size);
  line-height: 1.32;
  font-weight: var(--hero-tagline-weight);
  -webkit-line-clamp: 2;
  max-height: 74px;
}

.lede {
  max-width: 610px;
  min-height: 84px;
  margin-top: 22px;
  color: #3f4f68;
  font-size: var(--hero-lede-size);
  line-height: 1.56;
  font-weight: 500;
  max-height: 84px;
}

.hero-actions {
  min-height: 50px;
  margin-top: 32px;
}

.button {
  min-height: 50px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 800;
}

.button.primary {
  background: #3f63ff;
  box-shadow: 0 16px 34px rgba(63, 99, 255, 0.22);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.86);
}

.button.secondary::before {
  color: var(--blue);
  font-family: var(--font-mono);
  content: "</>";
}

.tech-strip {
  gap: 10px;
  min-height: 84px;
  margin-top: 54px;
}

.tech-strip span {
  min-height: 34px;
  padding: 0 12px;
  color: #2a354a;
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 8px 22px rgba(43, 60, 92, 0.06);
}

.automation::before {
  content: "A";
}

.hero-art {
  width: 67%;
  height: 100%;
}

.hero-art img {
  object-position: center right;
}

.hero-product-panel {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100% - 72px));
  height: var(--hero-panel-height);
  margin: 0 34px 24px auto;
  padding: 24px;
  border: 1px solid rgba(219, 228, 239, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 64px rgba(34, 49, 78, 0.16);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.panel-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-product-panel h2 {
  margin: 0;
  color: #101624;
  min-height: 56px;
  max-height: 56px;
  font-size: var(--hero-panel-title-size);
  line-height: 1.28;
  font-weight: var(--hero-panel-title-weight);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-product-panel > p,
.product-panel > p {
  margin: 12px 0 0;
  color: #5f6e84;
  font-size: var(--hero-panel-body-size);
  line-height: 1.62;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-product-panel > p {
  min-height: 46px;
  max-height: 46px;
}

.hero-app-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.hero-app-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.88);
}

.hero-app-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.hero-app-item strong,
.hero-app-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-app-item strong {
  color: #151b2a;
  font-size: var(--hero-app-name-size);
  line-height: 1.2;
  white-space: nowrap;
}

.hero-app-item small {
  margin-top: 4px;
  color: #65738a;
  font-size: var(--hero-app-desc-size);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 33px;
  max-height: 33px;
}

.hero-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
}

.hero-signal-grid span {
  min-height: 72px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hero-signal-grid strong,
.hero-signal-grid small {
  display: block;
}

.hero-signal-grid strong {
  color: #101624;
  font-size: var(--hero-signal-size);
  line-height: 1.15;
}

.hero-signal-grid small {
  margin-top: 6px;
  color: #738097;
  font-size: 11px;
  line-height: 1.25;
}

.section {
  padding: 72px 72px;
}

.section-top {
  margin-bottom: 34px;
}

.section-top h2 {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 820;
}

.section-top p {
  max-width: 680px;
  font-size: 15px;
}

.apps-layout {
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 34px;
}

.app-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.app-card {
  min-height: 316px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
}



.app-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
}

.app-card h3 {
  min-height: 50px;
  font-size: 20px;
  line-height: 1.2;
}

.app-card p {
  min-height: 88px;
  max-height: 88px;
  margin: 14px 0 22px;
  font-size: 14px;
  line-height: 1.56;
}

.store-button,
.quiet-button {
  min-height: 40px;
  font-size: 13px;
}

.store-button {
  background: #111827;
}

.product-panel {
  position: sticky;
  top: 100px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88));
}

.product-panel h3 {
  margin: 0;
  color: #101624;
  font-size: 22px;
  line-height: 1.35;
}

.product-panel-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.product-panel-list a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #27344a;
  font-size: 13px;
  font-weight: 760;
}

.product-panel-list img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.product-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef3ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.product-icon.screenshot {
  background:
    linear-gradient(#fff, #fff) center 54% / 18px 12px no-repeat,
    linear-gradient(135deg, #12b5ff, var(--blue));
}

.product-icon.fit {
  background:
    radial-gradient(circle at center, #18c3cf 0 6px, transparent 7px),
    radial-gradient(circle at center, transparent 0 10px, #ff6d5f 11px 15px, transparent 16px),
    #fff1ee;
}

.product-icon.studio {
  background: #07101e;
  color: var(--cyan);
}

.lab-layout {
  grid-template-columns: minmax(360px, 1.06fr) repeat(3, minmax(170px, 0.72fr));
}

.terminal {
  box-shadow: none;
}

.mini-project,
.blog article,
.stack-grid article {
  box-shadow: none;
}

.about {
  grid-template-columns: 180px minmax(0, 0.78fr) minmax(320px, 0.82fr);
  gap: 42px;
}

.avatar {
  width: 168px;
  height: 168px;
  object-position: center 42%;
}

.about-copy h2 {
  font-size: 34px;
  line-height: 1.18;
}

.about-copy p {
  color: #40516a;
}

.focus-row {
  grid-column: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.focus-row span {
  min-width: 0;
  min-height: 58px;
}

.stack-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.newsletter {
  margin: 8px 72px 36px;
  background:
    linear-gradient(135deg, rgba(63, 99, 255, 0.1), rgba(49, 189, 117, 0.08)),
    #ffffff;
}



[data-theme="dark"] body {
  background-color: var(--bg);
}

[data-theme="dark"] .page-shell {
  background: rgba(16, 23, 38, 0.92);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .hero {
  background: rgba(13, 19, 32, 0.88);
}

[data-theme="dark"] .section {
  border-top-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .hero::before {
  background:
    linear-gradient(90deg, #0d1320 0%, rgba(13, 19, 32, 0.98) 34%, rgba(13, 19, 32, 0.68) 58%, rgba(13, 19, 32, 0.12) 100%),
    linear-gradient(180deg, rgba(13, 19, 32, 0) 76%, rgba(13, 19, 32, 0.92) 100%);
}

[data-theme="dark"] .tagline,
[data-theme="dark"] .hero-product-panel h2,
[data-theme="dark"] .product-panel h3,
[data-theme="dark"] .hero-app-item strong,
[data-theme="dark"] .hero-signal-grid strong {
  color: var(--ink);
}

[data-theme="dark"] .hero-product-panel,
[data-theme="dark"] .product-panel,
[data-theme="dark"] .hero-app-item,
[data-theme="dark"] .hero-signal-grid span,
[data-theme="dark"] .product-panel-list a {
  background: rgba(22, 31, 49, 0.86);
  border-color: var(--line);
}

[data-theme="dark"] .product-panel {
  background: rgba(22, 31, 49, 0.72);
}

[data-theme="dark"] .product-panel-list a {
  color: var(--ink);
}

[data-theme="dark"] .hero-product-panel > p,
[data-theme="dark"] .product-panel > p,
[data-theme="dark"] .hero-app-item small,
[data-theme="dark"] .hero-signal-grid small {
  color: var(--muted);
}

[data-theme="dark"] .newsletter {
  background:
    linear-gradient(135deg, rgba(63, 99, 255, 0.17), rgba(49, 189, 117, 0.1)),
    rgba(22, 31, 49, 0.72);
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 64px 48px 30px;
  }

  .hero-product-panel {
    height: auto;
    width: auto;
    margin: 0 48px 32px;
  }

  .hero-signal-grid {
    margin-top: 18px;
  }

  .hero-art {
    width: calc(100% - 96px);
    height: 420px;
    margin: 0 48px 48px;
  }

  .app-grid,
  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .apps-layout {
    grid-template-columns: 1fr;
  }

  .product-panel {
    position: static;
  }

  .about {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .focus-row {
    grid-column: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: 100%;
    margin: 0;
  }

  .site-header {
    min-height: 64px;
    padding: 0 16px;
  }

  .hero-copy {
    padding: 42px 18px 24px;
  }

  .hero h1 {
    min-height: 112px;
    font-size: var(--hero-mobile-title-size);
  }

  .tagline {
    min-height: 29px;
    max-height: 58px;
    font-size: var(--hero-mobile-tagline-size);
    -webkit-line-clamp: 2;
  }

  .lede {
    min-height: 50px;
    max-height: 75px;
    font-size: 16px;
    -webkit-line-clamp: 3;
  }

  .hero-product-panel {
    height: auto;
    margin: 0 18px 24px;
    padding: 18px;
  }

  .hero-product-panel h2 {
    min-height: 52px;
    max-height: 52px;
  }

  .hero-product-panel > p {
    min-height: 44px;
    max-height: 44px;
  }

  .hero-app-item {
    min-height: 72px;
  }

  .hero-signal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-signal-grid span {
    min-height: 66px;
    padding: 10px 8px;
  }

  .hero-signal-grid strong {
    font-size: var(--hero-signal-size);
  }

  .hero-art {
    width: calc(100% - 36px);
    height: 300px;
    margin: 0 18px 30px;
  }

  .section {
    padding: 48px 18px;
  }

  .section-top h2 {
    font-size: 28px;
  }

  .app-grid,
  .lab-layout,
  .stack-grid,
  .blog-grid,
  .newsletter {
    grid-template-columns: 1fr;
  }

  .app-card {
    min-height: auto;
  }

  .app-card h3 {
    min-height: 48px;
    max-height: 48px;
  }

  .app-card p {
    min-height: 88px;
    max-height: 88px;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .focus-row {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .newsletter {
    margin: 0 18px 28px;
  }
}



.page-shell {
  overflow: clip;
}

.product-panel {
  position: static;
  top: auto;
}

.site-header {
  transition:
    background-color var(--motion-med) var(--ease-standard),
    border-color var(--motion-med) var(--ease-standard),
    box-shadow var(--motion-med) var(--ease-standard),
    -webkit-backdrop-filter var(--motion-med) var(--ease-standard),
    backdrop-filter var(--motion-med) var(--ease-standard);
}

.site-header.is-scrolled {
  border-bottom-color: rgba(150, 166, 197, 0.34);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(33, 49, 79, 0.08);
}

[data-theme="dark"] .site-header.is-scrolled {
  border-bottom-color: rgba(110, 132, 174, 0.24);
  background: rgba(12, 18, 31, 0.9);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.26);
}

.lang-switcher {
  position: relative;
  isolation: isolate;
}

.lang-switcher::before {
  position: absolute;
  inset: 3px auto 3px 3px;
  z-index: 0;
  width: calc((100% - 6px) / 3);
  border-radius: 6px;
  background: var(--blue);
  box-shadow:
    0 8px 18px rgba(63, 99, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  content: "";
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition:
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-med) var(--ease-spring);
  will-change: transform;
}

.lang-switcher[data-active-lang]::before {
  opacity: 1;
}

.lang-switcher[data-active-lang="ja"]::before {
  transform: translate3d(100%, 0, 0);
}

.lang-switcher[data-active-lang="en"]::before {
  transform: translate3d(200%, 0, 0);
}

.lang-switcher button {
  position: relative;
  display: grid;
  place-items: center;
  z-index: 1;
  background: transparent;
  line-height: 1;
  text-align: center;
  transition:
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.lang-switcher button.is-active {
  background: transparent;
  color: #fff;
}

.header-tools button,
.button,
.store-button,
.quiet-button,
.product-panel-list a,
.page-links a {
  transition:
    transform var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-standard);
}

.header-tools > button:hover,
.button:hover,
.store-button:hover,
.quiet-button:hover,
.product-panel-list a:hover,
.page-links a:hover {
  transform: translate3d(0, -1px, 0);
}

.header-tools > button:active,
.button:active,
.store-button:active,
.quiet-button:active,
.product-panel-list a:active,
.page-links a:active {
  transform: translate3d(0, 0, 0);
  transition-duration: 70ms;
}

.app-card,
.mini-project,
.blog article,
.stack-grid article,
.focus-row span,
.tech-strip span,
.hero-app-item,
.hero-signal-grid span,
.product-panel-list a {
  transition:
    transform var(--motion-med) var(--ease-out),
    border-color var(--motion-med) var(--ease-standard),
    background-color var(--motion-med) var(--ease-standard),
    box-shadow var(--motion-med) var(--ease-out);
}

.app-card:hover,
.mini-project:hover,
.blog article:hover,
.stack-grid article:hover,
.focus-row span:hover,
.tech-strip span:hover,
.hero-app-item:hover,
.hero-signal-grid span:hover,
.product-panel-list a:hover {
  border-color: var(--hover-border);
  box-shadow: var(--hover-shadow);
  transform: translate3d(0, -2px, 0);
}

.app-icon,
.plus,
.hero-app-item img,
.product-panel-list img,
.mini-project > div:first-child,
.blog-image,
.avatar {
  transition:
    transform var(--motion-med) var(--ease-out),
    filter var(--motion-med) var(--ease-standard);
}

.app-card:hover .app-icon,
.app-card:hover .plus,
.hero-app-item:hover img,
.product-panel-list a:hover img,
.mini-project:hover > div:first-child,
.blog article:hover .blog-image {
  filter: saturate(1.05);
  transform: scale(1.02);
}

.avatar:hover {
  transform: translate3d(0, -1px, 0) scale(1.01);
}

.button.primary:hover,
.store-button:hover {
  box-shadow: 0 14px 34px rgba(63, 99, 255, 0.24);
}

.button.secondary:hover,
.quiet-button:hover,
.product-panel-list a:hover {
  border-color: var(--hover-border);
}

.reveal .motion-child {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity var(--motion-slow) var(--ease-out),
    transform var(--motion-slow) var(--ease-out),
    border-color var(--motion-med) var(--ease-standard),
    box-shadow var(--motion-med) var(--ease-out);
  transition-delay: calc(var(--motion-index, 0) * 32ms);
  will-change: opacity, transform;
}

.reveal.is-revealed .motion-child {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .lang-switcher::before,
  .lang-switcher button,
  .header-tools button,
  .button,
  .store-button,
  .quiet-button,
  .app-card,
  .mini-project,
  .blog article,
  .stack-grid article,
  .focus-row span,
  .tech-strip span,
  .hero-app-item,
  .hero-signal-grid span,
  .product-panel-list a,
  .app-icon,
  .plus,
  .hero-app-item img,
  .product-panel-list img,
  .mini-project > div:first-child,
  .blog-image,
  .avatar,
  .reveal,
  .reveal .motion-child {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(152, 164, 186, 0.4);
  border: 4px solid transparent;
  background-clip: padding-box;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(152, 164, 186, 0.7);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: rgba(155, 168, 188, 0.3);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(155, 168, 188, 0.5);
}

/* ---------- Print Styles ---------- */
@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .site-header,
  .hero-product-panel,
  .theme-toggle,
  .lang-switcher,
  .button,
  footer {
    display: none !important;
  }

  .page-shell {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .hero-copy {
    width: 100% !important;
  }

  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* Don't show URL for relative internal links */
  a[href^="#"]:after,
  a[href^="/"]:after {
    content: "";
  }
}
