/* Diana Białogrzywa — site styles */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-latin.60c06664b5.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-latin-ext.a8c4bd7cd7.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-italic-latin.6ee678c33f.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-italic-latin-ext.a04fc7ed18.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #f5f3ee;
  --surface: #fdfcf9;
  --text: #1a1917;
  --muted: #5f5b53;
  --faint: #706b62;
  --line: #e2ded4;
  --line-strong: #cfc9bc;
  --accent: #b2472c;
  --accent-soft: rgba(178, 71, 44, 0.09);
  --shadow: 0 1px 2px rgba(26, 25, 23, 0.04), 0 8px 24px -12px rgba(26, 25, 23, 0.12);
  --shadow-lift: 0 2px 4px rgba(26, 25, 23, 0.05), 0 24px 48px -20px rgba(26, 25, 23, 0.22);
  --stitch: rgba(26, 25, 23, 0.085);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235f5b53' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

  --max: 90rem;
  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --radius: 1.25rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1a1a18;
    --text: #efece6;
    --muted: #aaa59b;
    --faint: #8e897f;
    --line: #2a2926;
    --line-strong: #3a3934;
    --accent: #ec8d72;
    --accent-soft: rgba(236, 141, 114, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.8);
    --stitch: rgba(239, 236, 230, 0.07);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23aaa59b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121211;
  --surface: #1a1a18;
  --text: #efece6;
  --muted: #aaa59b;
  --faint: #8e897f;
  --line: #2a2926;
  --line-strong: #3a3934;
  --accent: #ec8d72;
  --accent-soft: rgba(236, 141, 114, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.8);
  --stitch: rgba(239, 236, 230, 0.07);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23aaa59b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Header height minus its 1px border, so a section's top border hides under it. */
  scroll-padding-top: calc(4.25rem - 1px);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1;
}

em {
  font-style: italic;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.4s var(--ease);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.55rem;
  background: var(--text);
  color: var(--bg);
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-links {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: 0.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--line-strong);
}
.theme-toggle:active {
  transform: scale(0.92);
}
.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}
/* Without JavaScript the toggle can't work, so hide it. */
:root:not(.js) .theme-toggle {
  display: none;
}

@media (max-width: 40rem) {
  .wordmark-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .nav a {
    padding-inline: 0.6rem;
  }
}

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

.hero {
  position: relative;
  padding-block: clamp(2rem, 5vw, 4rem) clamp(2.75rem, 5vw, 4.5rem);
  overflow: hidden;
}

/* A quiet field of cross stitches, fading out toward the text. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 0 45%;
  z-index: -1;
  background-image: linear-gradient(45deg, transparent 46%, var(--stitch) 46%, var(--stitch) 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--stitch) 46%, var(--stitch) 54%, transparent 54%);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 78% 40%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 70% at 78% 40%, #000 10%, transparent 70%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 5rem);
}
@media (max-width: 56rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero-title {
  font-size: clamp(3rem, 5.6vw, 7.25rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.hero-title span,
.hero-title em {
  display: block;
}
.hero-title em {
  color: var(--accent);
}

.hero-lead {
  max-width: 34rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.25vw, 1.3rem);
}

/* Home-screen style grid of every app icon. */
.hero-apps ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.6vw, 2.25rem) clamp(0.9rem, 2vw, 1.75rem);
  margin: 0;
  padding: 0 0 clamp(2.5rem, 5vw, 4rem);
  list-style: none;
}
/* Every other column sits lower, so the grid reads as a loose arrangement. */
.hero-apps li:nth-child(even) {
  transform: translateY(clamp(1.25rem, 3vw, 2.75rem));
}
.js .hero-apps li[data-reveal]:nth-child(even) {
  transform: translateY(calc(clamp(1.25rem, 3vw, 2.75rem) + 18px));
}
.js .hero-apps li[data-reveal]:nth-child(even).is-visible {
  transform: translateY(clamp(1.25rem, 3vw, 2.75rem));
}
.hero-apps a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
  text-decoration: none;
  border-radius: 1.25rem;
}
.hero-apps img {
  width: 100%;
  max-width: 8.5rem;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 14px 30px -14px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.hero-apps a:hover img {
  transform: translateY(-4px) rotate(-3deg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 22px 40px -16px rgba(0, 0, 0, 0.45);
}
.hero-apps span {
  max-width: 100%;
  line-height: 1.3;
  text-wrap: balance;
  transition: color 0.2s var(--ease);
}
.hero-apps a:hover span {
  color: var(--text);
}
@media (max-width: 56rem) {
  .hero-apps ul {
    max-width: 30rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-apps a:hover img {
    transform: none;
  }
}


.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9875rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.3s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.button:hover {
  border-color: var(--text);
}
.button:active {
  transform: scale(0.97);
}
.button-primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}
.button-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.3s var(--ease);
}
.button:hover svg {
  transform: translateY(2px);
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(2.75rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.section-title {
  font-size: clamp(2.75rem, 6vw, 5.75rem);
  line-height: 0.95;
}
.section-note {
  max-width: 30rem;
  color: var(--muted);
}

/* ---------- Apps ---------- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s var(--ease), background-color 0.4s var(--ease);
}
.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}

.app-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.app-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 6px 16px -6px rgba(0, 0, 0, 0.3);
  transition: transform 0.6s var(--ease);
}
.app-card:hover .app-icon {
  transform: rotate(-4deg) scale(1.04);
}

.app-category {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-name {
  margin-top: 1.75rem;
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  line-height: 1.05;
}
.app-tagline {
  margin-top: 0.4rem;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.25;
}
.app-description {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.975rem;
  line-height: 1.6;
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: auto 0 0;
  padding: 1.75rem 0 0;
  list-style: none;
}
.app-link {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.3s var(--ease);
}
.app-link:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
}
.app-link svg {
  width: 1.15rem;
  height: 1.15rem;
}
/* The Apple glyph sits optically high; nudge it to the visual centre. */
.app-link-appStore svg {
  margin-top: -2px;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
}
.about-intro {
  align-self: center;
  text-align: right;
}
@media (max-width: 52rem) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .about-intro {
    text-align: left;
  }
}

.about-statement {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.about-statement em {
  color: var(--accent);
}

.about-body p + p {
  margin-top: 1.1rem;
}
.about-body > p {
  color: var(--muted);
}
.about-body > .about-lead {
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  line-height: 1.25;
}


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

.site-footer {
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.875rem;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
@media (max-width: 40rem) {
  .footer-bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}
.footer-link {
  color: var(--muted);
  text-decoration-color: var(--line-strong);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
.footer-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* Email with a copy button (used in the Contact window). */
.footer-email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.copy-button {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.copy-button:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}
.copy-button svg {
  width: 0.9rem;
  height: 0.9rem;
}
:root:not(.js) .copy-button {
  display: none;
}
.copy-status {
  color: var(--muted);
  font-size: 0.8125rem;
}

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

.contact-dialog {
  width: min(34rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.25rem);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lift);
  overflow: auto;
}
.contact-dialog::backdrop {
  background: rgba(18, 18, 17, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.contact-dialog[open] {
  animation: dialog-in 0.35s var(--ease);
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.contact-dialog {
  --pad: clamp(1.5rem, 4vw, 2.25rem);
}
.contact-form,
.contact-sent {
  display: grid;
  gap: 1.1rem;
  padding: 0 var(--pad);
}
.contact-dialog-head {
  padding: var(--pad) var(--pad) 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.contact-dialog-title {
  font-size: clamp(2rem, 5vw, 2.6rem);
}
.dialog-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.dialog-close:hover {
  border-color: var(--line-strong);
}
.dialog-close svg {
  width: 1rem;
  height: 1rem;
}
.contact-dialog-lead {
  margin-top: -0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 30rem) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
.field {
  display: grid;
  gap: 0.4rem;
}
.field > span {
  color: var(--faint);
  font-size: 0.8125rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s var(--ease);
}
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.75rem;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.75rem;
  cursor: pointer;
}
.field textarea {
  min-height: 7.5rem;
  resize: vertical;
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--faint);
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.field em {
  font-style: normal;
  opacity: 0.8;
}
/* Honeypot for bots: off-screen, never seen by people. */
.field-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-error {
  color: var(--accent);
  font-size: 0.9rem;
}
.form-submit {
  width: 100%;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.form-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}
.contact-sent {
  padding-block: 0.5rem var(--pad);
  color: var(--muted);
}
.contact-sent:focus {
  outline: none;
}
.contact-sent-title {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.1;
}
.contact-dialog-direct {
  margin: 1.25rem var(--pad) 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.contact-dialog-direct a {
  color: var(--text);
}

/* ---------- Legal / simple pages ---------- */

.page {
  padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
}
.page-title {
  margin-top: 1.5rem;
  font-size: clamp(3rem, 9vw, 5.75rem);
  line-height: 0.95;
}
.page-meta {
  margin-top: 1.25rem;
  color: var(--faint);
  font-size: 0.9375rem;
}
.prose {
  max-width: 46rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

/* Privacy page: title and section index on the left, text on the right. */
.legal-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) minmax(0, 3fr);
  gap: 2rem clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
.legal-grid .page-title {
  margin-top: 0;
  font-size: clamp(2.5rem, 4.5vw, 4rem);
}
.legal-grid .page-meta {
  margin-top: 0.75rem;
}
.legal-grid .prose {
  max-width: 54rem;
}
.legal-grid .prose h2 {
  margin-top: 2.25rem;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}
.legal-grid .prose h2:first-child {
  margin-top: 0;
}
.legal-grid .prose p,
.legal-grid .prose ul {
  margin-top: 0.6rem;
}
.legal-grid .prose li + li {
  margin-top: 0.3rem;
}
.legal-grid .prose {
  margin-top: 0.5rem;
}
.legal-grid .prose h2 {
  scroll-margin-top: 2rem;
}
.legal-head {
  position: sticky;
  top: calc(4.25rem + 2rem);
}
.legal-toc ol {
  display: grid;
  gap: 0.35rem;
  margin: 1.5rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.legal-toc a {
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.legal-toc a:hover {
  color: var(--accent);
}
@media (max-width: 56rem) {
  .legal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .legal-head {
    position: static;
  }
}
.prose h2 {
  margin-top: 3rem;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  line-height: 1.1;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose p,
.prose ul {
  margin-top: 1rem;
  color: var(--muted);
}
.prose ul {
  padding-left: 1.25rem;
}
.prose li + li {
  margin-top: 0.4rem;
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose a {
  color: var(--text);
  text-decoration-color: var(--accent);
}
.prose a:hover {
  color: var(--accent);
}

/* Footer stays at the bottom of the window on short pages. */
main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.not-found {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding-block: 3rem;
  text-align: center;
}
.not-found-code {
  font-size: clamp(6rem, 18vw, 12rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.not-found-text {
  margin: 1rem 0 2rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* ---------- Motion ---------- */

/* Elements start hidden only when JavaScript is running, so the page is
   always readable without it. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .app-card:hover,
  .app-card:hover .app-icon {
    transform: none;
  }
}

@media print {
  .site-header,
  .hero::before,
  .theme-toggle,
  .copy-button {
    display: none !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
