/* My Script website, in Soft Gallery.
   Tokens are copied from the design system (https://claude.ai/artifact/PjurLgk5BMEkTTBrQGZ6J2, project/tokens.json)
   and the components follow its bundle.css: one pale material lit from the top left, raised shapes you press,
   hollows that hold things, and photos that run edge to edge and fade into the ground, never boxed.
   Lexend is served from /fonts under the SIL Open Font Licence (fonts/OFL.txt). Nothing loads from another host. */

@font-face { font-family: "Lexend"; src: url("/fonts/lexend-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #eceef4;
  --face: #f5f6fa;
  --face-low: #e2e5ee;
  --well: #eceef4;
  --ink: #1b1d2e;
  --ink-muted: #565b72;
  --hairline: #dcdfe9;
  --key-outline: rgba(27, 27, 47, 0);
  --focus: #2f6feb;
  --coral: #ff7a5c;
  --coral-ink: #b83a20;
  --danger: #a3301b;
  --tomato: #ff5a3c;
  --sun-tint: #fff1cc;
  --grape-tint: #e9e3ff;
  --leaf-tint: #d9f4e7;
  --tomato-tint: #ffe2db;

  --hl: rgba(255, 255, 255, 0.95);
  --sh: rgba(146, 154, 186, 0.5);
  --clay: linear-gradient(145deg, var(--face), var(--face-low));
  --raised: -8px -8px 18px var(--hl), 9px 11px 22px var(--sh), inset 0 0 0 rgba(0, 0, 0, 0), inset 0 0 0 rgba(0, 0, 0, 0);
  --raised-small: -4px -4px 10px var(--hl), 5px 6px 12px var(--sh), inset 0 0 0 rgba(0, 0, 0, 0), inset 0 0 0 rgba(0, 0, 0, 0);
  --pressed: -1px -1px 2px var(--hl), 1px 2px 3px var(--sh), inset 6px 7px 13px var(--sh), inset -5px -5px 11px var(--hl);
  --inset: inset 5px 6px 12px var(--sh), inset -5px -5px 10px var(--hl);
  --fade-0: rgba(236, 238, 244, 0);
  --fade-90: rgba(236, 238, 244, 0.9);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --press-down: 70ms;
  --press-up: 380ms;
  --press-travel: 1px;
  --outline-width: 2px;

  --font-sans: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --edge: 24px;
  --column: 560px;
}

/* High contrast: the design system's second theme, for people who ask their device for more contrast. */
@media (prefers-contrast: more) {
  :root {
    --ground: #ffffff;
    --face: #ffffff;
    --face-low: #ffffff;
    --well: #ffffff;
    --ink-muted: #3d3d52;
    --hairline: #9a9fb8;
    --key-outline: #1b1b2f;
    --coral-ink: #9a2e17;
    --hl: rgba(0, 0, 0, 0);
    --sh: rgba(27, 27, 47, 0.9);
    --fade-0: rgba(255, 255, 255, 0);
    --fade-90: rgba(255, 255, 255, 0.92);
  }
}

/* ========== Base ========== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; margin: 0;
  background: var(--ground); color: var(--ink);
  font: 400 1rem/1.625 var(--font-sans);
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere;
}
main { flex: 1 0 auto; }
img { max-width: 100%; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.button:focus-visible { border-radius: 28px; }
p { margin: 0 0 1rem; }

/* ========== Layout ========== */
/* One column, at most 560 wide, 24 from the screen edge. */
.page { position: relative; z-index: 1; width: 100%; max-width: calc(var(--column) + 2 * var(--edge)); margin: 0 auto; padding: 0 var(--edge); }

/* A first screen with its words low down. The photo fills the space above them and fades into the
   ground at its foot, so however tall the words grow (large text, a small phone) they never sit on it. */
.hero { position: relative; display: flex; flex-direction: column; min-height: 92vh; min-height: min(100svh, 940px); padding: 0 0 40px; }
.hero__content { display: flex; flex-direction: column; gap: 16px; margin-top: -40px; }

/* ========== Photos: edge to edge, fading into the ground, never boxed ========== */
.photo { position: relative; display: block; margin: 0; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.photo--fill { flex: 1 1 auto; min-height: 220px; overflow: hidden; }
.photo--fill img { position: absolute; inset: 0; }
.photo--fill::after { background: linear-gradient(180deg, var(--fade-0) 50%, var(--fade-90) 84%, var(--ground) 100%); }
.photo--strip { height: 320px; }
.photo--strip::after { background: linear-gradient(180deg, var(--fade-0) 40%, var(--fade-90) 76%, var(--ground) 100%); }
@media (min-width: 768px) { .photo--strip { height: 400px; } }

/* ========== Type ========== */
/* Headings in two weights: light 300 with the key words in bold 700. */
/* Big type grows with the reader's text size, up to what a word can fit across a narrow screen. */
.display { margin: 0; font-size: min(2.25rem, 13vw); line-height: 1.1667; font-weight: 300; letter-spacing: -0.01em; overflow-wrap: normal; }
.display b { font-weight: 700; }
.display--hero { font-size: min(clamp(3rem, 14vw, 5rem), 19vw); line-height: 1; letter-spacing: -0.02em; }
@media (min-width: 768px) { .display:not(.display--hero) { font-size: 3rem; line-height: 1.1667; } }
.lede { margin: 0; font-size: 1.125rem; line-height: 1.5; color: var(--ink-muted); }
.caption { margin: 0; font-size: 0.8125rem; line-height: 1.4; color: var(--ink-muted); }
.label { margin: 0; font-size: 0.875rem; line-height: 1.3; font-weight: 600; color: var(--ink-muted); }

/* The header of a reading page: a strip photo, then the title low over its fade. */
.page-head { display: flex; flex-direction: column; gap: 12px; margin-top: -88px; padding-bottom: 8px; }
.home-link { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-size: 0.875rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.home-link:hover { text-decoration: underline; }

/* Long text: privacy, terms and help. */
.prose { padding-bottom: 24px; }
.prose > :first-child { margin-top: 32px; }
.prose h2 { margin: 2.5rem 0 0.75rem; font-size: 1.25rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.005em; }
.prose h3 { margin: 1.75rem 0 0.5rem; font-size: 1rem; line-height: 1.4; font-weight: 700; }
.prose ul { margin: 0 0 1rem; padding: 0; list-style: none; }
.prose li { position: relative; margin: 0 0 0.5rem; padding-left: 22px; }
.prose li::before { content: ""; position: absolute; left: 2px; top: 0.68em; width: 7px; height: 7px; border-radius: 4px; background: var(--coral); }
.prose li ul { margin: 0.5rem 0 0; }
.prose li li::before { background: none; box-shadow: inset 0 0 0 1.5px var(--ink-muted); }
.prose strong { font-weight: 600; }
.table { width: 100%; margin: 0 0 1rem; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; overflow-wrap: normal; }
.table th, .table td { padding: 12px 16px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
.table thead th { font-size: 0.8125rem; font-weight: 600; color: var(--ink-muted); }
.table tbody th { font-weight: 700; }
/* On a phone each company becomes a block, with the column names above each part. */
@media (max-width: 559px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table, .table tbody, .table tr, .table th, .table td { display: block; }
  .table tr { padding: 16px 0; border-bottom: 1px solid var(--hairline); }
  .table th, .table td { padding: 0; border: 0; }
  .table td { margin-top: 8px; }
  .table td::before { content: attr(data-label); display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-muted); }
}

/* ========== Material and press ========== */
/* A raised pill you press. Pressing sinks it into a hollow in 70 ms; letting go springs back over 380 ms. */
.button {
  position: relative; display: inline-flex; flex-direction: column; min-height: 52px; min-width: 44px; margin: 0; padding: 0;
  border: var(--outline-width) solid var(--key-outline); border-radius: 28px;
  background: var(--clay); box-shadow: var(--raised-small); color: var(--ink);
  font: 600 1rem/1.25 var(--font-sans); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: box-shadow 280ms var(--ease-out), transform var(--press-up) var(--spring);
}
.button__face { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; text-align: center; transition: transform var(--press-up) var(--spring); }
.button:active { box-shadow: var(--pressed); transform: translateY(var(--press-travel)); transition-duration: var(--press-down); transition-timing-function: var(--ease-out); }
.button:active .button__face { transform: scale(0.97); transition-duration: var(--press-down); transition-timing-function: var(--ease-out); }
/* The one main action on a page: coral, with ink text (6.5:1). */
.button--primary { background: linear-gradient(145deg, #ff9479, #f9664a); }
.button--block { display: flex; width: 100%; min-height: 56px; }
.actions { display: flex; flex-direction: column; gap: 16px; }

/* A hollow holds things: a code, a note. */
.hollow { padding: 20px; border: var(--outline-width) solid var(--key-outline); border-radius: 24px; background: var(--well); box-shadow: var(--inset); }
.code {
  display: flex; align-items: center; justify-content: center; min-height: 88px; margin: 0; padding: 8px 16px;
  border: var(--outline-width) solid var(--key-outline); border-radius: 24px; background: var(--well); box-shadow: var(--inset);
  font: 700 min(2.25rem, 10vw)/1.1 var(--font-sans); letter-spacing: 0.12em; text-indent: 0.12em; text-transform: uppercase; font-variant-numeric: tabular-nums;
  overflow-wrap: normal; white-space: nowrap;
}
.alert { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 0.9375rem; line-height: 1.35; font-weight: 600; color: var(--danger); }
.alert::before { content: ""; width: 10px; height: 10px; flex-shrink: 0; border-radius: 5px; background: var(--tomato); }

/* ========== Invite links ========== */
.invite { display: flex; flex-direction: column; gap: 16px; }
.invite .code { margin-top: 8px; }
.invite .actions { margin-top: 8px; }
/* Numbered steps, each number in a small hollow. */
.steps { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; min-height: 32px; margin: 0 0 0.875rem; padding: 3px 0 0 48px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 16px; background: var(--well);
  box-shadow: inset 3px 4px 8px var(--sh), inset -3px -3px 7px var(--hl);
  font-size: 0.875rem; font-weight: 700; line-height: 1;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ========== Example scripts (home) ========== */
/* Only script pictures sit inside a container: the key, its face tinted with the category colour. */
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 8px 0 0; padding: 0; list-style: none; }
@media (min-width: 560px) { .keys { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.key {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 148px; padding: 16px 8px 14px;
  border: var(--outline-width) solid var(--key-outline); border-radius: 30px;
  background: var(--t); background: linear-gradient(145deg, color-mix(in srgb, var(--t) 50%, #fff), var(--t));
  box-shadow: var(--raised); text-align: center; font-size: 1rem; line-height: 1.2; font-weight: 600;
}
.key img { width: 72px; height: 72px; flex-shrink: 0; }
.key--grape { --t: var(--grape-tint); }
.key--leaf { --t: var(--leaf-tint); }
.key--sun { --t: var(--sun-tint); }
.key--tomato { --t: var(--tomato-tint); }
.soon { margin: 48px 0 0; font-size: 1.5rem; line-height: 1.25; font-weight: 300; letter-spacing: -0.005em; }
.soon b { font-weight: 700; }

/* ========== Footer ========== */
.footer { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 56px; padding: 0 var(--edge) 40px; padding-bottom: max(40px, env(safe-area-inset-bottom)); text-align: center; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 4px; }
.footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 0.9375rem; font-weight: 600; }
.footer nav a[aria-current="page"] { text-decoration-thickness: 2px; }
.footer nav span { color: var(--ink-muted); }
.footer p { max-width: 100%; margin: 0; font-size: 0.8125rem; line-height: 1.5; color: var(--ink-muted); }
.footer p a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .button, .button__face { transition: box-shadow 280ms var(--ease-out); }
  .button:active, .button:active .button__face { transform: none; }
}
