/* danebowman.com: one stylesheet, no framework. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Amethyst palette */
  --bg: #24103D;
  --raised: #4B1E7A;
  --accent: #7038A5;      /* decorative only (2.3:1 on --bg) */
  --accent-2: #A56DE2;    /* 4.84:1 on --bg */
  --soft: #D6B6F5;        /* 9.76:1 on --bg */
  --text: #F3E8FF;        /* 14.6:1 on --bg */

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.5rem, 6vw, 6rem);
  --measure: 72rem;

  /* Motion tokens (see docs/superpowers/specs/2026-12-05-motion-design.md) */
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);  /* entering, answering input */
  --dur-press: 150ms;
  --dur-hover: 150ms;                          /* with the ease keyword */
  --dur-enter: 350ms;
  --dur-glow: 500ms;
  --stagger-hero: 90ms;
  --stagger-card: 60ms;
  --rise: 8px;
}

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

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  /* A calm wash at the top, over the canvas's faint 24px dot grid. */
  background:
    linear-gradient(180deg, rgba(75, 30, 122, 0.55) 0, rgba(75, 30, 122, 0) 32rem),
    radial-gradient(rgba(214, 182, 245, 0.16) 0.8px, transparent 1.1px) 0 0 / 24px 24px,
    var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(4.5rem, 14vh, 9rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}

.page--short { display: flex; align-items: center; }

/* ---------- Masthead ---------- */

.eyebrow {
  margin: 0 0 1.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
}

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(3.5rem, 18vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: #fff;
}

.name--small {
  font-size: clamp(2.5rem, 9vw, 5.5rem);
  line-height: 1;
}

.tagline {
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  max-width: 22ch;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.625rem, 4.6vw, 2.75rem);
  line-height: 1.18;
  letter-spacing: -0.005em;
  color: var(--soft);
}

/* ---------- Squircle corners ----------
   Every widget box is masked to a G2 continuous-curvature squircle. /squircle.svg is a
   superellipse (n = 4, see tools/make_squircle.py); it is placed at each corner at
   2 x --sq-r, and two solid bands fill the middle. Works in Chrome, Safari and Firefox,
   at any box size, without stretching. Masks clip outlines and shadows, so edges and
   focus rings are drawn as extra squircle layers instead. */

.card,
.card::before,
.cta__face,
.cta::before,
.cta::after {
  -webkit-mask:
    url("/squircle.svg") 0 0 / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    url("/squircle.svg") 100% 0 / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    url("/squircle.svg") 0 100% / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    url("/squircle.svg") 100% 100% / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * var(--sq-r)) 100% no-repeat,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * var(--sq-r)) no-repeat;
  mask:
    url("/squircle.svg") 0 0 / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    url("/squircle.svg") 100% 0 / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    url("/squircle.svg") 0 100% / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    url("/squircle.svg") 100% 100% / calc(2 * var(--sq-r)) calc(2 * var(--sq-r)) no-repeat,
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * var(--sq-r)) 100% no-repeat,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * var(--sq-r)) no-repeat;
}

/* ---------- The one call to action ---------- */

.cta {
  --r: 28px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
  color: var(--bg);              /* 9.76:1 on the lilac face */
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: scale var(--dur-press) var(--ease-out);
}

.cta__face {
  --sq-r: var(--r);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 3.5rem;            /* 56px: well over the 44px tap target */
  padding: 0.9rem 1.85rem;
  background: var(--soft);
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1.2;
  transition: background-color var(--dur-hover) ease;
}

.cta__face::after {
  content: "\2192";               /* → */
  display: inline-block;
  font-weight: 500;
  transition: translate var(--dur-hover) var(--ease-out);
}

.cta:active { scale: 0.97; }

@media (hover: hover) and (pointer: fine) {
  .cta:hover .cta__face { background: var(--text); }
  .cta:hover .cta__face::after { translate: 3px 0; }
}

/* Focus: a squircle ring (outer layer) with a canvas-coloured gap (inner layer). */
.cta::before,
.cta::after {
  content: "";
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cta::before { inset: -6px; --sq-r: calc(var(--r) + 6px); z-index: -2; background: var(--text); }
.cta::after  { inset: -3px; --sq-r: calc(var(--r) + 3px); z-index: -1; background: var(--bg); }
.cta:focus-visible { outline: none; }
.cta:focus-visible::before,
.cta:focus-visible::after { opacity: 1; }

/* ---------- Widgets (level 1 cards on the dot-grid canvas) ---------- */

.widgets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.25rem);
  margin-top: clamp(3.5rem, 9vw, 6rem);
}

/* Wide: who Dane is (two halves), then the channel (three thirds), then contact. */
@media (min-width: 64rem) {
  .widgets { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .card--study,
  .card--band { grid-column: span 6; }
  .card--live,
  .card--cover,
  .card--approach { grid-column: span 4; }
  .card--contact { grid-column: 1 / -1; }
}

.card {
  --r: 46px;
  --pad: clamp(1.5rem, 3.2vw, 2.25rem);
  --edge: 1px;
  --sq-r: var(--r);
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  padding: var(--pad);
  /* The 1px edge: lit at the top, fading down the sides. */
  background: linear-gradient(180deg, rgba(214, 182, 245, 0.42) 0, rgba(165, 109, 226, 0.16) 3rem, rgba(112, 56, 165, 0.22) 100%);
  color: var(--text);
}

/* The face, inset by the edge width. */
.card::before {
  content: "";
  position: absolute;
  inset: var(--edge);
  z-index: -1;
  --sq-r: calc(var(--r) - var(--edge));
  background: linear-gradient(163deg, #391962 0%, #2D1450 34%, #29124A 72%);
}

.card__big {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #fff;
}

.card__text {
  margin: 0;
  max-width: 34rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--soft);
}

/* The contact card: the address link stretches over the whole card, so the card is the
   target. Wide surfaces brighten on press instead of scaling (3% of a wide card reads as a jump). */
.card__mail {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
  /* The underline grows from the left on hover (drawn as a background, so it can animate). */
  background: linear-gradient(currentColor 0 0) 0 100% / 0 1px no-repeat;
  padding-bottom: 0.1em;
  transition: background-size var(--dur-hover) var(--ease-out);
}
.card__mail::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card--contact { transition: filter var(--dur-hover) ease; }
.card--contact:active { filter: brightness(1.14); }

@media (hover: hover) and (pointer: fine) {
  .card--contact:hover { filter: brightness(1.08); }
  .card--contact:active { filter: brightness(1.14); }
  .card--contact:hover .card__mail { background-size: 100% 1px; }
}
.card__mail:focus-visible { outline: none; }
.card--contact:has(.card__mail:focus-visible) { --edge: 3px; background: var(--text); }

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

.footer {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 2.5rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

.footer p { margin: 0; }

/* ---------- Focus, skip link, motion ---------- */

a:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  z-index: 10;
}

.skip:focus { top: 1rem; }

/* ---------- Motion ----------
   One short, ordered entrance on first load: name, tagline, button (90ms apart), then the
   widgets in view (60ms apart). Keyframes define only `from`, so the resting state is the
   normal, visible page: if an animation never runs, nothing is hidden. Cards that start
   below the fold are held back by site.js (only when motion is allowed) and play the same
   entrance once when scrolled to. */

@keyframes arrive { from { opacity: 0; translate: 0 var(--rise); } }
@keyframes arrive-soft { from { opacity: 0; translate: 0 var(--rise); filter: blur(2px); } }
@keyframes glow-in { from { opacity: 0; } }

.masthead {
  position: relative;
  isolation: isolate;
}

/* A soft, static Amethyst glow behind the name. Fades in once; never moves or loops. */
.masthead::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40%;
  left: -10%;
  width: min(62rem, 110%);
  height: 150%;
  background: radial-gradient(closest-side, rgba(165, 109, 226, 0.22), rgba(112, 56, 165, 0.10) 55%, rgba(112, 56, 165, 0) 100%);
  pointer-events: none;
  animation: glow-in var(--dur-glow) var(--ease-out) both;
}

/* Order in line (set here, not inline: the CSP blocks style attributes). */
.masthead > :nth-child(2),
.widgets > :nth-child(2) { --order: 1; }
.masthead > :nth-child(3),
.widgets > :nth-child(3) { --order: 2; }
.widgets > :nth-child(4) { --order: 3; }
.widgets > :nth-child(5) { --order: 4; }
.widgets > :nth-child(6) { --order: 5; }

.masthead > * {
  animation: arrive-soft var(--dur-enter) var(--ease-out) both;
  animation-delay: calc(var(--order, 0) * var(--stagger-hero));
}

.widgets > .card {
  animation: arrive var(--dur-enter) var(--ease-out) both;
  animation-delay: calc(3 * var(--stagger-hero) + var(--order, 0) * var(--stagger-card));
}

/* Held back by site.js until scrolled to, then the same entrance, once. */
.widgets > .card.is-pending {
  opacity: 0;
  translate: 0 var(--rise);
  animation: none;
}
.widgets > .card.is-revealed {
  animation: arrive var(--dur-enter) var(--ease-out) var(--reveal-delay, 0ms) both;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .cta:active { scale: none; }
  .widgets > .card.is-pending { opacity: 1; translate: none; }
}
