/* Windthorn Development: calm, pale pastel, light only.
   Tokens, tints, base, then components top to bottom of the page.
   No inline styles anywhere: the Content-Security-Policy forbids them.
   Contrast (WCAG): every text colour here is >= 4.5:1 on the surface it
   sits on; icons, focus rings and field borders are >= 3:1. */

:root {
  color-scheme: light;

  --bg: #fbfbfa;
  --bg-elev: #ffffff;
  --ink: #1b2130;
  --ink-2: #4b5364;
  --ink-3: #667081;
  --line: #e6e8ec;
  --field-line: #8a91a0;
  --danger: #b3261e;
  --chip: rgba(255, 255, 255, .62);

  /* Pastel surfaces and the deep accent that sits on each of them. */
  --mint: #dcf2e8;      --mint-deep: #1e6b57;
  --lavender: #e6e2f8;  --lavender-deep: #5347a6;
  --peach: #fde5d8;     --peach-deep: #a04c28;
  --sky: #dbebfa;       --sky-deep: #2a6499;
  --butter: #faf0c8;    --butter-deep: #7d6410;
  --blush: #fbe1e8;     --blush-deep: #ac3a5b;

  /* The current accent. A page or tile sets these through .tint-*;
     with no tint, the accent is plain ink on white. */
  --t: var(--bg-elev);
  --t-deep: var(--ink);
  --t-on: #ffffff;

  --r-lg: 28px;
  --r: 20px;
  --r-sm: 12px;
  --shadow-1: 0 1px 2px rgba(27, 33, 48, .04), 0 10px 30px -14px rgba(27, 33, 48, .12);
  --shadow-2: 0 2px 6px rgba(27, 33, 48, .05), 0 28px 56px -22px rgba(27, 33, 48, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --max: 1040px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* One fluid type scale. */
  --fs-0: clamp(.875rem, .85rem + .12vw, .95rem);
  --fs-1: clamp(1rem, .95rem + .25vw, 1.125rem);
  --fs-2: clamp(1.125rem, 1.04rem + .45vw, 1.375rem);
  --fs-3: clamp(1.375rem, 1.2rem + .9vw, 1.875rem);
  --fs-4: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);
  --fs-5: clamp(2.25rem, 1.2rem + 5.2vw, 5.25rem);
}

.tint-mint     { --t: var(--mint);     --t-deep: var(--mint-deep); }
.tint-lavender { --t: var(--lavender); --t-deep: var(--lavender-deep); }
.tint-peach    { --t: var(--peach);    --t-deep: var(--peach-deep); }
.tint-sky      { --t: var(--sky);      --t-deep: var(--sky-deep); }
.tint-butter   { --t: var(--butter);   --t-deep: var(--butter-deep); }
.tint-blush    { --t: var(--blush);    --t-deep: var(--blush-deep); }

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

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-1);
  line-height: 1.6;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}
/* Two faint pastel washes behind everything. Gradients only, no filters. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 6% 0%, color-mix(in srgb, var(--mint) 65%, transparent), transparent 70%),
    radial-gradient(45% 40% at 100% 8%, color-mix(in srgb, var(--lavender) 55%, transparent), transparent 70%);
}
a { color: var(--t-deep); text-underline-offset: .18em; }
img { max-width: 100%; }
svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--t-deep); outline-offset: 3px; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: 1rem; z-index: 100;
  transform: translateY(-200%);
  background: var(--ink); color: var(--bg);
  padding: .6rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 600;
}
.skip:focus { transform: none; }
.label {
  margin: 0 0 1.25rem;
  font-size: var(--fs-0); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3);
}

/* Header: a floating pill ------------------------------------------------ */

.site-header {
  position: sticky; top: 0; z-index: 20;
  padding-top: .75rem;
  pointer-events: none; /* only the pill itself takes clicks */
}
.site-header .container {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  min-height: 3.5rem; padding: .4rem .45rem .4rem .5rem;
  background: rgba(255, 255, 255, .82);
  background: color-mix(in srgb, var(--bg-elev) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(27, 33, 48, .04);
  transition: box-shadow .35s var(--ease);
}
.site-header.is-scrolled .container { box-shadow: var(--shadow-1); }
.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em;
  border-radius: 999px;
}
.brand svg {
  width: 36px; height: 36px; padding: 7px; flex: none;
  border-radius: 999px; background: var(--mint); color: var(--mint-deep);
}
.nav { display: flex; align-items: center; gap: .1rem; }
.nav a {
  color: var(--ink-2); text-decoration: none;
  padding: .5rem .8rem; border-radius: 999px;
  font-size: var(--fs-0); font-weight: 500; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--ink); background: rgba(27, 33, 48, .06); }
.nav a[aria-current] { color: var(--ink); font-weight: 600; background: rgba(27, 33, 48, .07); }

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 999px;
  font: inherit; font-size: var(--fs-1); font-weight: 600; line-height: 1.2;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .2s, border-color .2s;
}
.btn-primary { background: var(--t-deep); color: var(--t-on); box-shadow: var(--shadow-1); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.btn-ghost { background: var(--bg-elev); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-lg { padding: 1rem 1.75rem; font-size: var(--fs-2); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

/* Home: hero and manifesto ---------------------------------------------- */

.hero { padding-block: clamp(3.5rem, 11vw, 8rem) clamp(2rem, 5vw, 3.5rem); }
.display {
  font-size: var(--fs-5); font-weight: 600; letter-spacing: -.035em; line-height: 1.02;
  max-width: 18ch; text-wrap: balance;
}
.display-line { display: block; }
/* The last line is the promise under the two headlines. */
.display-line:not(:first-child):last-child {
  margin-top: .5em;
  font-size: var(--fs-3); font-weight: 500; letter-spacing: -.015em; line-height: 1.25;
  color: var(--ink-2); max-width: 28ch;
}

.manifesto { padding-block: 0 clamp(3rem, 8vw, 6rem); }
.manifesto p {
  margin: 0; padding-top: 2rem; border-top: 1px solid var(--line);
  max-width: 58ch; font-size: var(--fs-2); line-height: 1.6; color: var(--ink-2);
  text-wrap: pretty;
}

/* Home: project tiles, two floating columns ------------------------------ */

.projects { padding-block: 0 clamp(2rem, 5vw, 3rem); }
.section-title { font-size: var(--fs-3); margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.tiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(1rem, 2.2vw, 1.75rem);
  grid-template-columns: minmax(0, 1fr);
}
.tile {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  aspect-ratio: 4 / 3;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  border-radius: var(--r-lg);
  border: 1px solid rgba(27, 33, 48, .05);
  border-color: color-mix(in srgb, var(--t-deep) 12%, transparent);
  background: var(--t);
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #fff 58%, var(--t)), var(--t) 62%);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { aspect-ratio: 1 / 1; }
  /* The second column floats a little lower than the first. */
  .tiles > li:nth-child(even) { margin-top: clamp(1.5rem, 4vw, 3rem); }
}
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tile-icon {
  width: clamp(3.25rem, 5vw, 4rem); height: clamp(3.25rem, 5vw, 4rem); flex: none;
  border-radius: 18px; background: var(--chip); color: var(--t-deep);
  display: grid; place-items: center;
}
.tile-icon svg { width: 50%; height: 50%; }
.tile-go {
  width: 2.5rem; height: 2.5rem; flex: none;
  border-radius: 999px; background: var(--chip); color: var(--t-deep);
  display: grid; place-items: center;
  transition: background-color .3s, color .3s, transform .45s var(--ease);
}
.tile-go svg { width: 1.1rem; height: 1.1rem; }
.tile-text { max-width: 32ch; }
.tile-name { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); letter-spacing: -.025em; margin-bottom: .4rem; }
.tile-summary { margin: 0; color: var(--ink-2); text-wrap: pretty; }

@media (hover: hover) {
  .tile:hover { transform: scale(1.03); box-shadow: var(--shadow-2); }
  .tile:hover .tile-go { background: var(--t-deep); color: var(--t-on); transform: translateX(2px); }
  .tile[rel~="external"]:hover .tile-go { transform: translate(2px, -2px); }
}
.tile:focus-visible { transform: scale(1.03); box-shadow: var(--shadow-2); outline-offset: 6px; }
.tile:focus-visible .tile-go { background: var(--t-deep); color: var(--t-on); }
.tile:active { transform: scale(1.01); }

/* Inner pages: hero and panel ------------------------------------------- */

.page-hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 3rem); }
.page-hero h1 {
  font-size: var(--fs-4); letter-spacing: -.03em; line-height: 1.05;
  margin-bottom: .6rem; max-width: 20ch; text-wrap: balance;
}
.page-hero .lead { margin: 0; font-size: var(--fs-2); color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.page-icon {
  width: 3.5rem; height: 3.5rem; margin-bottom: 1.5rem;
  border-radius: 16px; background: var(--t); color: var(--t-deep);
  display: grid; place-items: center;
}
.page-icon svg { width: 1.75rem; height: 1.75rem; }
.panel {
  border-radius: var(--r-lg);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border: 1px solid rgba(27, 33, 48, .05);
  border-color: color-mix(in srgb, var(--t-deep) 12%, transparent);
  background: var(--t);
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #fff 58%, var(--t)), var(--t) 62%);
  box-shadow: var(--shadow-1);
}
.panel .page-icon { background: var(--chip); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1.75rem; }

/* Project page ---------------------------------------------------------- */

.project-body {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem);
}
@media (min-width: 860px) {
  .project-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start; }
  .project-side { position: sticky; top: 6.5rem; }
}
.prose p { max-width: 56ch; font-size: var(--fs-2); line-height: 1.6; color: var(--ink-2); margin: 0 0 1.25rem; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.features li { display: flex; gap: .75rem; align-items: flex-start; text-wrap: pretty; }
.features svg { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .2em; color: var(--t-deep); }
.get { margin-top: 2rem; background: var(--t); border-radius: var(--r); padding: 1.5rem; }
.note { margin: 1rem 0 0; font-size: var(--fs-0); color: var(--ink-2); }
.quiet { margin: 0; color: var(--ink-2); }
.back {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--ink-2); text-decoration: none; font-weight: 500; border-radius: 6px;
  transition: color .2s;
}
.back svg { width: 1.1rem; height: 1.1rem; transition: transform .35s var(--ease); }
.back:hover { color: var(--ink); }
.back:hover svg { transform: translateX(-3px); }

/* Contact --------------------------------------------------------------- */

.split {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.form { display: grid; gap: 1.25rem; }
.field label { display: block; font-weight: 600; font-size: var(--fs-0); margin-bottom: .45rem; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: var(--fs-1); padding: .85rem 1rem;
  border: 1px solid var(--field-line); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--t);
}
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field.invalid input:focus, .field.invalid textarea:focus { border-color: var(--danger); box-shadow: 0 0 0 4px var(--blush); }
.error { color: var(--danger); font-size: var(--fs-0); margin: .45rem 0 0; }
.notice {
  margin: 0; padding: .9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev);
}
.notice.error { border-color: var(--danger); background: var(--blush); font-size: var(--fs-1); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.aside { background: var(--t); border-radius: var(--r); padding: 1.75rem; }
.aside h2 { font-size: var(--fs-1); margin-bottom: 1rem; }
.aside p { margin: 1.25rem 0 0; color: var(--ink-2); font-size: var(--fs-0); }
.aside h2 + p, .aside > p:first-child { margin-top: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; counter-reset: item; }
.checks li { display: flex; gap: .75rem; align-items: flex-start; color: var(--ink-2); }
.checks li::before {
  counter-increment: item; content: counter(item);
  flex: none; width: 1.5rem; height: 1.5rem; margin-top: .1em;
  border-radius: 999px; background: var(--chip); color: var(--t-deep);
  font-size: .8rem; font-weight: 600; display: grid; place-items: center;
}

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

.site-footer {
  margin-top: clamp(3rem, 8vw, 6rem); padding-block: 0 2.5rem;
  font-size: var(--fs-0); color: var(--ink-3);
}
.site-footer .container {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 1.5rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Responsive and motion ------------------------------------------------- */

@media (max-width: 820px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .brand span { display: none; }
  .nav { gap: 0; }
  .nav a { padding: .45rem .5rem; }
}
@media (max-width: 370px) {
  .nav a { padding: .45rem .4rem; font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .tile:hover, .tile:focus-visible, .tile:active, .btn-primary:hover, .back:hover svg,
  .tile:hover .tile-go, .tile:focus-visible .tile-go { transform: none; }
}
