/* ==========================================================================
   InSync landing page
   Colors are the exact AppColors tokens from the Xcode project
   (SharedContent/Resources/Assets.xcassets/Colors). Fonts follow AppFonts:
   Title/Headline = SF Pro Bold, Body = SF Compact Rounded Semibold,
   Chord = SF Compact Rounded Regular — served here as system fonts.
   ========================================================================== */

:root {
  /* Surfaces, text & neutrals */
  --background: #F6F6F6;
  --foreground: #0A0A0A;
  --card: #FFFFFF;
  --card-foreground: #232323;
  --card-shadow: #D2CDC3;
  --primary: #232323;
  --primary-line: #1B1B1B;
  --secondary-foreground: #7D7D7D;
  --muted: #E8E9EB;
  --muted-foreground: #7D7D7D;
  --button: #454545;
  --button-shadow: #232323;
  --shadow: #C9C9C9;
  --border: rgba(60, 60, 67, 0.18);            /* BorderColor #3C3C43 @ 18% */
  --border-on-dark: rgba(125, 125, 125, 0.35);  /* MutedForeground #7D7D7D */
  --white: #FFFFFF;                             /* DestructiveForeground / LabelForeground9 */

  /* Accent & interaction */
  --secondary: #535EFF;
  --secondary-shadow: #3E36B2;
  --ring: #5B52F0;
  --selected: #E5D4FF;
  --destructive: #EE5858;

  /* Section tags · label / foreground pairs */
  --label-1: #EFEAFE; --label-fg-1: #6F39F7;
  --label-2: #E1EBFF; --label-fg-2: #2553C8;
  --label-3: #EAF8EF; --label-fg-3: #0FBC65;
  --label-4: #FFE2EF; --label-fg-4: #E42781;
  --label-5: #E4F8FF; --label-fg-5: #00AEFE;
  --label-6: #FFF8D7; --label-fg-6: #FB9325;
  --label-7: #D9F5F1; --label-fg-7: #0B7A72;

  /* Highlights & status dots */
  --highlight-1: #FEE066;
  --highlight-2: #A8C8FF;
  --highlight-5: #FFB8D8;
  --dot-3: #379E66;

  /* Type */
  --font-title: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-body: ui-rounded, "SF Pro Rounded", "SF Compact Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-card: 24px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--card-foreground);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.02em;
}

p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 8px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--primary);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons (V2 / Button / Pill) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.btn svg { flex: none; }

.btn-primary {
  background: var(--secondary);
  color: var(--white);
  box-shadow: 0 6px 0 var(--secondary-shadow);
}
.btn-primary:hover { transform: translateY(2px); box-shadow: 0 4px 0 var(--secondary-shadow); }
.btn-primary:active { transform: translateY(6px); box-shadow: 0 0 0 var(--secondary-shadow); }

.btn-dark {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 6px 0 var(--primary-line);
}
.btn-dark:hover { transform: translateY(2px); box-shadow: 0 4px 0 var(--primary-line); }
.btn-dark:active { transform: translateY(6px); box-shadow: 0 0 0 var(--primary-line); }

.btn-neutral {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 6px 0 var(--shadow), inset 0 0 0 1px var(--border);
}
.btn-neutral:hover { transform: translateY(2px); box-shadow: 0 4px 0 var(--shadow), inset 0 0 0 1px var(--border); }
.btn-neutral:active { transform: translateY(6px); box-shadow: 0 0 0 var(--shadow), inset 0 0 0 1px var(--border); }

.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }

/* ---------- Tags (V2 / Tag) ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
}
.tag-purple { background: var(--label-1); color: var(--label-fg-1); }
.tag-blue   { background: var(--label-2); color: var(--label-fg-2); }
.tag-green  { background: var(--label-3); color: var(--label-fg-3); }
.tag-pink   { background: var(--label-4); color: var(--label-fg-4); }
.tag-cyan   { background: var(--label-5); color: var(--label-fg-5); }
.tag-yellow { background: var(--label-6); color: var(--label-fg-6); }
.tag-teal   { background: var(--label-7); color: var(--label-fg-7); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 246, 246, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.nav-logo img { height: 30px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--secondary-foreground);
  font-size: 16px;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--primary); }

/* ---------- Section scaffolding ---------- */

.section { padding: clamp(56px, 7vw, 96px) 0; }
.section-tight { padding-bottom: 0; }

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(32px, 4vw, 48px);
  text-align: center;
}
.section-head h2 {
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.1;
}
.section-head p {
  margin-top: 16px;
  font-size: clamp(17px, 1.8vw, 20px);
  color: var(--secondary-foreground);
}
.eyebrow {
  display: block;
  margin-bottom: 14px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--secondary);
}

/* ---------- Hero (mirrors HIFI VER.2 · Frame 2) ---------- */

.hero {
  position: relative;
  background: var(--card);
  padding: clamp(48px, 8vw, 96px) 0 0;
  overflow: hidden;
  isolation: isolate;
}
.hero-inner { text-align: center; }

.hero-mark {
  width: clamp(64px, 8vw, 84px);
  height: auto;
  margin: 0 auto 24px;
}
.hero h1 {
  font-size: clamp(40px, 7.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero h1 span { color: var(--secondary); }
.hero-lead {
  max-width: 760px;
  margin: 22px auto 0;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
  color: var(--secondary-foreground);
}
.hero-lead strong { color: var(--primary); font-weight: 700; }
.hero-tag { margin-bottom: 22px; }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}

.hero-device {
  position: relative;
  max-width: 1040px;
  margin: clamp(40px, 5vw, 64px) auto 0;
  padding-bottom: clamp(32px, 4vw, 56px);
}

/* Equalizer bars + accent wash behind the iPad */
.hero-bars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(260px, 42vw, 620px);
  z-index: -1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  gap: clamp(8px, 1.1vw, 14px);
  pointer-events: none;
}
.hero-bars span {
  flex: 0 0 clamp(26px, 3.2vw, 53px);
  height: var(--h, 70%);
  border-radius: 999px 999px 0 0;
  background: var(--border);
  transform-origin: bottom;
  animation: bar 5s var(--ease) infinite alternate;
  animation-delay: var(--d, 0s);
}
.hero-wash {
  position: absolute;
  inset: auto 0 0 0;
  height: clamp(300px, 48vw, 700px);
  z-index: -1;
  background: linear-gradient(180deg, rgba(83, 94, 255, 0) 0%, rgba(83, 94, 255, 0.55) 100%);
  pointer-events: none;
}
@keyframes bar {
  from { transform: scaleY(1); }
  to   { transform: scaleY(0.9); }
}

/* ---------- iPad frame ---------- */

.ipad {
  position: relative;
  background: var(--primary-line);
  border-radius: clamp(20px, 3.4vw, 44px);
  padding: clamp(8px, 1.5vw, 20px);
  box-shadow: 0 0 0 1.5px var(--button), 0 30px 60px -20px rgba(35, 35, 35, 0.45);
}
.ipad img {
  width: 100%;
  border-radius: clamp(12px, 2vw, 26px);
  aspect-ratio: 1194 / 834;
  object-fit: cover;
  object-position: top left;
  background: var(--muted);
}

/* ---------- Problem ---------- */

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 0 var(--card-shadow);
  padding: 28px;
}
.icon-tile {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--button) 0%, var(--primary) 100%);
  color: var(--white);
  box-shadow: 0 3px 0 var(--button-shadow);
  margin-bottom: 22px;
}
.card h3 { font-size: 21px; line-height: 1.25; }
.card p { margin-top: 10px; color: var(--secondary-foreground); }

/* ---------- Main feature (dark, mirrors Live Session) ---------- */

.feature {
  background: var(--primary-line);
  color: var(--white);
}
.feature .section-head h2 { color: var(--white); }
.feature .section-head p { color: var(--muted-foreground); }

.feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.feature-layout .ipad {
  background: var(--primary);
  box-shadow: 0 0 0 1.5px var(--button), 0 30px 60px -20px rgba(10, 10, 10, 0.6);
}

.feature-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
}
.feature-points li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.feature-points .icon-tile {
  margin: 0;
  background: var(--secondary);
  box-shadow: 0 3px 0 var(--secondary-shadow);
}
.feature-points h3 { color: var(--white); font-size: 20px; line-height: 1.3; }
.feature-points p { margin-top: 6px; color: var(--muted-foreground); }

/* Live section strip — mirrors the leader sidebar's NOW row */
.live-strip {
  margin-top: clamp(32px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  border: 1px solid var(--border-on-dark);
  color: var(--muted-foreground);
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.live-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-foreground);
  transition: background-color 0.4s var(--ease);
}
.live-chip .now {
  display: none;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  color: var(--white);
}
.live-chip.is-now {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
  transform: translateY(-2px);
}
.live-chip.is-now::before { background: var(--white); }
.live-chip.is-now .now { display: inline; }

.daw-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 15px;
  margin-right: 8px;
}
.daw-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot-3);
  box-shadow: 0 0 0 0 rgba(55, 158, 102, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(55, 158, 102, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(55, 158, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(55, 158, 102, 0); }
}

/* ---------- How it works ---------- */

.steps { display: grid; gap: clamp(48px, 7vw, 88px); }

.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  grid-template-areas: "text shot";
  gap: clamp(28px, 4.5vw, 64px);
  align-items: center;
}
.step:nth-child(even) {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas: "shot text";
}
.step-text { grid-area: text; }
.step .shot { grid-area: shot; }

.step-num {
  display: block;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 80px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--secondary);
  margin-bottom: 14px;
}
.step-text h3 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
.step-text p { margin-top: 12px; font-size: 18px; color: var(--secondary-foreground); }
.step-text .tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* ---------- Setup ---------- */

.setup { background: var(--card); }

.needs {
  list-style: none;
  margin: 0 0 clamp(32px, 4vw, 48px);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.needs li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  background: var(--background);
  border: 1px solid var(--border);
}
.needs .icon-tile { width: 40px; height: 40px; border-radius: 11px; margin: 0; }
.needs span { color: var(--primary); line-height: 1.3; }
.needs small {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--secondary-foreground);
  font-weight: 600;
}

/* Setup guide — mirrors MIDISetupView's guide header and step cards */
.guide-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 16px;
}
.guide-head h3 { font-size: 25px; }
.guide-head p, .guide-count { margin-top: 4px; color: var(--primary); }

.guide {
  list-style: none;
  margin: 0;
  padding: 0 24px;
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 0 var(--card-shadow);
}
.guide-step + .guide-step { border-top: 1px solid var(--muted); }
.guide-step { scroll-margin-top: 84px; }

.guide-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  grid-template-areas: "title chev" "sub chev";
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  width: 100%;
  min-height: 76px;
  padding: 15px 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.guide-title {
  grid-area: title;
  display: flex;
  gap: 12px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 17px;
  color: var(--primary);
}
.guide-num { min-width: 12px; }
.guide-sub {
  grid-area: sub;
  color: var(--secondary-foreground);
  font-weight: 400;
}
.guide-chevron {
  grid-area: chev;
  color: var(--secondary-foreground);
  transition: transform 0.22s ease-in-out;
}
.guide-toggle[aria-expanded="true"] .guide-chevron { transform: rotate(180deg); }
.guide-toggle:hover .guide-title { color: var(--secondary); }

.guide-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.22s ease-in-out, opacity 0.22s ease-in-out;
}
.guide-panel[hidden] { display: none; }
.guide-panel.is-open { grid-template-rows: 1fr; opacity: 1; }
.guide-panel-inner {
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 32px;
}
.guide-panel.is-open .guide-panel-inner { padding: 10px 0 25px; }
.guide-panel-inner { transition: padding 0.22s ease-in-out; }

.guide-media {
  position: relative;
  flex: 0 0 auto;
  width: min(var(--w), 100%);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
}
.guide-media img { width: 100%; border-radius: 16px; }
.guide-media-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.55);
  color: var(--white);
  transition: transform 0.2s var(--ease);
}
.guide-media:hover .guide-media-icon { transform: scale(1.08); }

.guide-body { flex: 1 1 auto; min-width: 0; display: grid; gap: 19px; }
.guide-points {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 19px;
  color: var(--secondary-foreground);
  font-weight: 400;
}
.guide-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--destructive);
  font-weight: 400;
}
.guide-note svg { flex: none; margin-top: 3px; }

/* Media viewer — full screen like MIDISetupMediaViewer */
.media-viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--foreground);
}
.media-viewer::backdrop { background: var(--foreground); }
.media-viewer[open] { display: grid; place-items: center; animation: fade 0.22s ease-in-out; }
.media-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 88px 24px 24px;
}
.media-stage video, .media-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}
.media-close {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 3px 0 var(--shadow);
  z-index: 1;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- CTA ---------- */

.cta {
  position: relative;
  background: var(--secondary);
  color: var(--white);
  border-radius: clamp(24px, 3vw, 36px);
  padding: clamp(40px, 7vw, 80px) clamp(24px, 5vw, 64px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 8px 0 var(--secondary-shadow);
}
.cta h2 { color: var(--white); font-size: clamp(30px, 4.6vw, 48px); line-height: 1.1; }
.cta p { margin: 16px auto 0; max-width: 560px; font-size: clamp(17px, 1.8vw, 20px); color: var(--selected); }
.cta .btn { margin-top: 32px; }
.cta .btn-neutral { box-shadow: 0 6px 0 var(--secondary-shadow); }
.cta .btn-neutral:hover { box-shadow: 0 4px 0 var(--secondary-shadow); }
.cta-mark {
  position: absolute;
  width: clamp(160px, 22vw, 260px);
  right: clamp(-60px, -3vw, -20px);
  bottom: clamp(-60px, -3vw, -20px);
  opacity: 0.14;
  z-index: -1;
}

/* ---------- Support ---------- */

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}
.support-grid .card { display: flex; flex-direction: column; gap: 6px; }
.support-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-foreground);
}
.support-value {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.support-value:hover { color: var(--secondary); }
.support-grid .card p { margin-top: 4px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
}
.footer-inner img { height: 26px; width: auto; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a { color: var(--secondary-foreground); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.copyright { color: var(--secondary-foreground); font-size: 14px; }

/* ---------- Legal page ---------- */

/* Dark header band — mirrors the app's dark page headers */
.legal-hero {
  background: var(--primary);
  color: var(--white);
  padding: clamp(32px, 5vw, 56px) 0 clamp(88px, 10vw, 120px);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.2s var(--ease);
}
.back-link:hover { color: var(--white); }
.legal-hero h1 { color: var(--white); font-size: clamp(36px, 6vw, 60px); line-height: 1.05; }
.legal-hero p { margin-top: 12px; max-width: 640px; color: var(--muted-foreground); font-size: clamp(16px, 1.8vw, 19px); }
.legal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.legal-meta .tag { border-color: var(--border-on-dark); background: var(--primary-line); color: var(--white); text-transform: none; letter-spacing: 0; }

.legal { margin-top: clamp(-88px, -8vw, -64px); padding-bottom: clamp(56px, 7vw, 96px); }

.glance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.glance .card { padding: 20px; }
.glance .icon-tile {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: var(--secondary);
  box-shadow: 0 3px 0 var(--secondary-shadow);
}
.glance h2 { font-size: 17px; line-height: 1.3; }
.glance p { margin-top: 4px; font-size: 15px; color: var(--secondary-foreground); }

.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.legal-toc {
  position: sticky;
  top: 88px;
  padding: 20px;
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
}
.legal-toc b {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-foreground);
}
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--secondary-foreground);
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.legal-toc a::before { content: counter(toc); min-width: 16px; color: var(--muted-foreground); }
.legal-toc a:hover { background: var(--background); color: var(--primary); }
.legal-toc a.is-active { background: var(--label-1); color: var(--label-fg-1); }
.legal-toc a.is-active::before { color: var(--label-fg-1); }

.legal-card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 0 var(--card-shadow);
  padding: clamp(24px, 4vw, 48px);
}
.legal-intro { font-size: 17px; color: var(--primary); }
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--label-6);
  color: var(--label-fg-6);
}
.notice svg { flex: none; margin-top: 3px; }

.legal-section {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--muted);
  scroll-margin-top: 88px;
}
.legal-section h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.25;
}
.legal-section h2 span { color: var(--secondary); }
.legal-section p, .legal-section li { color: var(--button); font-weight: 400; }
.legal-section p { margin-top: 10px; }
.legal-section ul { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.legal-section li::marker { color: var(--secondary); }
.legal-section strong { color: var(--primary); font-weight: 700; }
.legal a { color: var(--secondary); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.contact-grid > div {
  padding: 16px;
  border-radius: 16px;
  background: var(--background);
  border: 1px solid var(--border);
}
.contact-grid .support-value { display: inline-block; margin-top: 4px; font-size: 17px; }

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bars span, .daw-chip::before { animation: none; }
  .btn, .live-chip { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .feature-layout { grid-template-columns: minmax(0, 1fr); }
  .feature-points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .feature-points li { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .needs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .legal-toc { display: none; }
}

@media (max-width: 860px) {
  .problem-grid { grid-template-columns: minmax(0, 1fr); }
  .step, .step:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "text" "shot";
    gap: 24px;
  }
  .feature-points { grid-template-columns: minmax(0, 1fr); }
  .feature-points li { grid-template-columns: 52px minmax(0, 1fr); gap: 18px; }
  .guide-panel-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .support-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .guide-head { flex-direction: column; align-items: flex-start; }
  .guide-count { display: none; }
  .guide { padding: 0 16px; }
}

@media (max-width: 560px) {
  .needs { grid-template-columns: minmax(0, 1fr); }
  .glance { gap: 12px; }
  .glance .card { padding: 16px; }
  .glance .icon-tile { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 10px; }
  .glance .icon-tile svg { width: 18px; height: 18px; }
  .glance h2 { font-size: 16px; }
  .glance p { font-size: 14px; }
}

@media (max-width: 480px) {
  .nav-logo img { height: 26px; }
  .hero-cta .btn { width: 100%; }
  .card { padding: 22px; }
  .daw-chip { margin-right: 0; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
