/* tunetheory.app shared stylesheet.
   Colors, radii, and fonts come from brand/tokens.css only. Light theme only.
   Load order in every page: site.css, then the Google Fonts link for Fraunces
   (so the variable web font wins over the local fallback declared here). */

@import url("brand/tokens.css");

@font-face {
  font-family: "Fraunces";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("brand/Fraunces72pt-SemiBold.ttf") format("truetype");
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--tt-bg);
  color: var(--tt-ink);
  font-family: var(--tt-font-text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }   /* keep aspect ratio when width/height attributes are set */

a { color: var(--tt-accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--tt-accent); outline-offset: 3px; border-radius: var(--tt-radius-s); }

h1, h2, h3 {
  font-family: var(--tt-font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  color: var(--tt-ink);
}
h1 { font-size: clamp(40px, 6.5vw, 68px); letter-spacing: -0.02em; }
h2 { font-size: clamp(30px, 4vw, 40px); }
h3 { font-size: 22px; }
p  { margin: 0 0 1em; }

.lead { color: var(--tt-ink-2); font-size: clamp(19px, 2vw, 22px); line-height: 1.4; }
.small { color: var(--tt-ink-3); font-size: 14px; }
.mono { font-family: var(--tt-font-mono); font-variant-numeric: tabular-nums; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Long-form pages: support, privacy, press kit, guides */
.prose { max-width: 68ch; }
.wrap.prose { max-width: 1080px; }                 /* keep the page grid; limit line length per block */
.wrap.prose > :not(.asset-grid):not(.shots):not(.cards):not(.grips):not(.video) { max-width: 68ch; }
.prose h2 { font-size: clamp(26px, 3vw, 32px); margin-top: 48px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 20px; margin-top: 28px; margin-bottom: 6px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose img, .prose svg { margin: 16px 0; }
.page-head { padding-top: 40px; padding-bottom: 8px; }   /* keep .wrap's side padding */
.page-head h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 8px; }
.page-head .lead { margin: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; background: var(--tt-bg-2); color: var(--tt-ink); border-radius: var(--tt-capsule); padding: 6px 14px; font-size: 15px; }
.toc a:hover { text-decoration: none; background: var(--tt-surface-muted); }
.note { background: var(--tt-surface); border-radius: var(--tt-radius-l); padding: 16px 20px; color: var(--tt-ink-2); }

.skip-link {
  position: absolute; left: 20px; top: -100px;
  background: var(--tt-surface); color: var(--tt-ink);
  padding: 8px 14px; border-radius: var(--tt-radius-m); z-index: 10;
}
.skip-link:focus { top: 12px; }

/* ---------- Wordmark (text version, for header and footer) ---------- */

.wordmark {
  font-family: var(--tt-font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--tt-ink);
  text-decoration: none;
  display: inline-block;
}
.wordmark:hover, .wordmark:focus-visible { text-decoration: none; }
.wordmark .theory { color: var(--tt-wordmark-warm); }

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

.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.site-header .wordmark { font-size: 26px; }
.site-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.site-nav a {
  color: var(--tt-ink-2);
  padding: 8px 14px;
  border-radius: var(--tt-capsule);
  font-size: 15px;
}
.site-nav a:hover, .site-nav a:focus-visible { background: var(--tt-bg-2); color: var(--tt-ink); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--tt-bg-2); color: var(--tt-ink); }

/* ---------- Hero ---------- */

.hero {
  background: var(--tt-gradient);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: end;
  gap: 40px;
  min-height: 560px;
}
.hero-copy { padding: 56px 0 72px; }
.hero-copy .mark { width: 96px; height: 96px; margin-bottom: 28px; }
.hero-copy h1 { margin-bottom: 12px; }
.hero-copy .lead { margin-bottom: 20px; }
.hero-copy .body { max-width: 34em; margin-bottom: 32px; }

.badge { display: inline-block; }
.badge img { height: 54px; width: auto; }

.hero-phone { display: flex; justify-content: center; align-self: end; padding-top: 56px; }
.phone {
  width: min(360px, 100%);
  margin-bottom: -22%;          /* bleeds off the bottom of the hero */
  border: 10px solid var(--tt-ink);
  border-bottom: 0;
  border-radius: 48px 48px 0 0;
  background: var(--tt-ink);
  box-shadow: var(--tt-shadow);
  overflow: hidden;
}
.phone img { width: 100%; height: auto; border-radius: 38px 38px 0 0; }

/* ---------- Sections and cards ---------- */

.section { padding: 72px 0; }
.section-head { max-width: 40em; margin-bottom: 40px; }
.section-head .lead { margin: 0; }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--tt-surface);
  border-radius: var(--tt-radius-l);
  padding: 24px;
}
.card h3 { margin-bottom: 6px; }
.card p:last-child { margin-bottom: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li {
  background: var(--tt-bg-2);
  border-radius: var(--tt-capsule);
  padding: 6px 14px;
  font-size: 15px;
}

.button {
  display: inline-block;
  background: var(--tt-accent);
  color: var(--tt-surface);
  padding: 12px 20px;
  border-radius: var(--tt-radius-l);
  font-weight: 600;
}
.button:hover, .button:focus-visible { text-decoration: none; opacity: .92; }

/* ---------- Feature rows: copy beside a phone ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 48px;
  align-items: center;
}
.feature-alt .feature-grid > .feature-copy { order: 2; }
.feature-alt .feature-grid > .feature-phone { order: 1; }
.feature-copy h3 { margin-top: 28px; margin-bottom: 6px; font-size: 20px; }
.feature-copy .chips { margin: 10px 0 4px; }
.feature-phone { display: flex; justify-content: center; gap: 16px; }
.feature-phone-pair .phone { width: min(240px, 48%); }

.phone-full {
  margin-bottom: 0;
  border-bottom: 10px solid var(--tt-ink);
  border-radius: 48px;
  width: min(320px, 100%);
}
.phone-full img { border-radius: 38px; }

.plain-list { padding-left: 0; margin: 0 0 1em; list-style: none; }
.plain-list li { padding-left: 1.1em; position: relative; margin-bottom: 8px; }
.plain-list li::before {
  content: "";
  position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tt-accent);
}
.card .plain-list li::before { background: var(--tt-ink-3); }

.kits { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 0; }
.kits > div { background: var(--tt-surface); border-radius: var(--tt-radius-l); padding: 18px 20px; }
.kits dt { font-family: var(--tt-font-display); font-weight: 600; font-optical-sizing: auto; font-size: 20px; margin-bottom: 4px; }
.kits dd { margin: 0; color: var(--tt-ink-2); }

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

.privacy .wrap { max-width: 720px; text-align: center; }
.privacy p:last-child { margin-bottom: 0; }

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

.site-footer { padding: 56px 0 40px; border-top: 1px solid var(--tt-bg-2); }
.site-footer .wrap { display: grid; gap: 28px; grid-template-columns: 1fr auto; align-items: start; }
.site-footer .wordmark { font-size: 22px; margin-bottom: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 20px; }
.footer-nav a { color: var(--tt-ink-2); }
.footer-nav a:hover { color: var(--tt-ink); }
.site-footer .small { margin: 0; }

/* ---------- The mark's lock animation (plays once, about two seconds) ----------
   Start pose: needle swung 42 degrees left and orange, wave slid 26 units left.
   Resolves to the locked pose: needle centered and verdigris, wave still. */

.mark .arc, .mark .tick, .mark .wave { stroke: var(--tt-accent); fill: none; stroke-linecap: round; }
.mark .arc  { stroke-width: 13; }
.mark .tick { stroke-width: 5; }
.mark .wave { stroke-width: 6; }
.mark .needle { stroke: var(--tt-in-tune); stroke-width: 9; fill: none; stroke-linecap: round; }
.mark .pivot  { fill: var(--tt-in-tune); stroke: none; }

.mark-anim .needle  { transform-origin: 100px 122px; }
.mark-anim .needle,
.mark-anim .pivot   { animation: tt-needle 1.6s cubic-bezier(.34, 1.4, .64, 1) both, tt-lock 2s step-end both; }
.mark-anim .wave    { animation: tt-wave 1.6s cubic-bezier(.34, 1.4, .64, 1) both; }

@keyframes tt-needle {
  from { transform: rotate(-42deg); }
  to   { transform: rotate(0deg); }
}
@keyframes tt-wave {
  from { transform: translateX(-26px); }
  to   { transform: translateX(0); }
}
@keyframes tt-lock {
  0%, 74% { stroke: var(--tt-accent); fill: var(--tt-accent); }
  75%, 100% { stroke: var(--tt-in-tune); fill: var(--tt-in-tune); }
}
.mark-anim .needle { fill: none; }
.mark-anim .pivot  { stroke: none; }

@media (prefers-reduced-motion: reduce) {
  .mark-anim .needle, .mark-anim .pivot, .mark-anim .wave { animation: none; }
  .mark-anim .needle { stroke: var(--tt-in-tune); }
  .mark-anim .pivot  { fill: var(--tt-in-tune); }
}

/* ---------- Phone width ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 12px; min-height: 0; }
  .hero-phone { padding-top: 0; }
  .hero-copy { padding: 36px 0 24px; text-align: center; }
  .hero-copy .mark { margin-left: auto; margin-right: auto; width: 80px; height: 80px; margin-bottom: 20px; }
  .hero-copy .body { margin-left: auto; margin-right: auto; }
  .phone { width: min(300px, 86%); margin-bottom: -30%; }
  .section { padding: 56px 0; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature-alt .feature-grid > .feature-copy { order: 1; }
  .feature-alt .feature-grid > .feature-phone { order: 2; }
  .phone-full { width: min(260px, 80%); }
  .feature-phone-pair .phone { width: min(200px, 48%); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
