/* Carry the Story — shared site styles.
   Tokens mirror brand/tokens/carry-the-story.css and style-guide.html. */

:root {
  --ink: #123c3a;
  --night: #071e1d;
  --gold: #f2b84b;
  --ivory: #fff8ea;
  --sky: #7eb8c1;
  --coral: #d96c4e;
  --line: rgb(18 60 58 / 18%);
  --muted: #52706d;
  --display: "Fraunces", "Noto Serif TC", Georgia, serif;
  --ui: "Instrument Sans", "Noto Sans TC", system-ui, sans-serif;
  --max: 800px;
  --page-pad: clamp(1.25rem, 5vw, 3rem);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 4%, rgb(242 184 75 / 11%), transparent 22rem),
    var(--ivory);
  font: 400 1rem/1.7 var(--ui);
  text-rendering: optimizeLegibility;
}

/* Same paper grain as the style guide, so the pages feel like the app. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .22;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

a { color: inherit; text-underline-offset: .25em; }
a:hover { color: var(--coral); }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: .75rem;
  left: .75rem;
  padding: .7rem 1rem;
  transform: translateY(-180%);
  background: var(--gold);
  color: var(--night);
  border-radius: .75rem;
}

.skip-link:focus { transform: none; }

header, main, footer {
  width: min(100%, calc(var(--max) + var(--page-pad) * 2));
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

nav {
  padding: 1.4rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  font-size: .82rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -.02em;
  font-size: 1.05rem;
}

.brand img { width: 2.9rem; }

nav .links { display: flex; gap: 1.25rem; }

nav .links a {
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}

nav .links a:hover { text-decoration: underline; text-underline-offset: .35rem; }

.hero { margin: clamp(2.5rem, 8vw, 5rem) 0 3rem; }

/* Landing hero: the mark earns real size here, the way the style guide shows it.
   Inner pages keep the plain .hero and never load this. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(13rem, .9fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
}

.hero-mark::before {
  content: "";
  position: absolute;
  inset: -6% -4% -6% -4%;
  border: 1px solid rgb(18 60 58 / 20%);
  border-radius: 52% 48% 45% 55% / 46% 43% 57% 54%;
  transform: rotate(8deg);
}

.hero-mark img {
  position: relative;
  width: min(100%, 17rem);
  filter: drop-shadow(0 1.5rem 1.75rem rgb(7 30 29 / 12%));
}

@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; justify-items: start; }
  .hero-mark::before { display: none; }
  .hero-mark img { width: min(100%, 11rem); }
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--coral);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  max-width: 14ch;
  margin: 0 0 1.1rem;
  font: 650 clamp(2.6rem, 8vw, 4.6rem)/.95 var(--display);
  letter-spacing: -.05em;
}

h2 {
  margin: 3rem 0 .8rem;
  font: 620 clamp(1.5rem, 3.4vw, 2rem)/1.15 var(--display);
  letter-spacing: -.03em;
}

h3 {
  margin: 2rem 0 .5rem;
  font: 600 1.15rem/1.3 var(--display);
}

.lede {
  max-width: 42rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.stamp {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: .85rem;
}

/* The single most important fact on a page, pulled out of the prose. */
.fact {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-left: .4rem solid var(--gold);
  border-radius: 1.1rem;
  box-shadow: 0 12px 40px rgb(18 60 58 / 6%);
}

.fact strong { color: var(--coral); }

ul { padding-left: 1.15rem; }
li { margin-bottom: .5rem; }

.cards {
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.3rem 1.4rem;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
}

.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; color: var(--muted); font-size: .95rem; }

.button {
  min-height: 3rem;
  margin-top: 1.5rem;
  padding: .72rem 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--ink);
  border-radius: .8rem;
  color: var(--ivory);
  background: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.button:hover { color: var(--ivory); background: var(--night); }

dl { margin: 1.5rem 0; }
dt { margin-top: 1.5rem; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
dd { margin: .35rem 0 0; color: var(--muted); }

footer {
  margin-top: 4rem;
  padding-block: 1.75rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

@media (max-width: 560px) {
  nav { flex-wrap: wrap; }
  .brand span { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
