/* Brightmoss Labs. A quiet studio page: one column of type, the Seed Grid mark, and one app card. */
:root {
  --ground: #f6f7f3;      /* page, warm off-white with a hint of moss */
  --paper: #ffffff;       /* raised surfaces */
  --ink: #141a16;         /* primary text */
  --ink-soft: #5b665e;    /* secondary text */
  --hairline: #e1e5de;    /* dividers */
  --moss: #2b6b45;        /* accent, deep moss */
  --moss-tint: #e8f0e9;   /* accent wash */
  --sprout: #86bf5f;
  --sun: #efae34;
  --gold: #9c7b3c;        /* motto accent, from the Factum est wallpaper */
  --shadow: 0 24px 48px -24px rgba(20, 40, 28, 0.28), 0 6px 14px -8px rgba(20, 40, 28, 0.14);

  --text: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
  --wide: 64rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d110e; --paper: #161c18; --ink: #eef2ee; --ink-soft: #9faba2; --hairline: #26302a;
    --moss: #6cbf84; --moss-tint: #16231b; --sprout: #a8da86; --sun: #f5c451; --gold: #c9a35c;
    --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7), 0 6px 14px -8px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0d110e; --paper: #161c18; --ink: #eef2ee; --ink-soft: #9faba2; --hairline: #26302a;
  --moss: #6cbf84; --moss-tint: #16231b; --sprout: #a8da86; --sun: #f5c451; --gold: #c9a35c;
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7), 0 6px 14px -8px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 100%/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--moss); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); margin: 0; font-optical-sizing: auto; text-wrap: balance; }
p { text-wrap: pretty; }

.wrap { max-width: var(--wide); margin-inline: auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Seed Grid mark: colors follow the theme */
.mark .d { fill: var(--moss); }
.mark .l { fill: var(--sprout); }
.mark .s { fill: var(--sun); }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--ground); }

/* Top bar */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: var(--ground);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand .mark { width: 26px; height: 26px; }
.nav { display: flex; gap: 22px; font-size: 0.9375rem; }
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero { padding-block: clamp(64px, 12vw, 140px) clamp(48px, 8vw, 96px); }
.hero .mark { width: clamp(72px, 10vw, 104px); height: auto; margin-bottom: 36px; }
.eyebrow { color: var(--moss); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em; margin: 0 0 14px; }
.hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.5rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700;
  max-width: 14ch;
}
.lede { color: var(--ink-soft); font-size: clamp(1.125rem, 1.8vw, 1.3125rem); line-height: 1.5; max-width: 34rem; margin: 22px 0 0; }

/* Sections */
.section { padding-block: clamp(48px, 8vw, 88px); border-top: 1px solid var(--hairline); }
.section h2 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); letter-spacing: -0.025em; line-height: 1.15; }
.section .sub { color: var(--ink-soft); margin: 10px 0 0; font-size: 1.0625rem; max-width: 34rem; }

/* App card */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 20px; margin-top: 36px; }
.app {
  position: relative;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 24px;
  padding: 24px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 64px 1fr; gap: 16px 18px; align-items: start;
}
.app .icon { width: 64px; height: 64px; border-radius: 15px; }
.app h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
.app .kind { color: var(--ink-soft); font-size: 0.875rem; margin: 2px 0 0; }
.app p.desc { grid-column: 1 / -1; margin: 0; font-size: 1rem; line-height: 1.55; }
.app .links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--ink); color: var(--ground); text-decoration: none;
  font-weight: 600; font-size: 0.9375rem;
}
.pill svg { width: 16px; height: 16px; }
.pill { transition: transform 120ms ease-out, opacity 120ms ease-out; -webkit-tap-highlight-color: transparent; }
.pill:hover { opacity: 0.88; }
.pill:active { transform: scale(0.97); opacity: 0.8; transition-duration: 60ms; }

/* Values */
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 28px 40px; margin-top: 36px; }
.values h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 6px; }
.values p { margin: 0; color: var(--ink-soft); }
.values .dot { width: 12px; height: 12px; border-radius: 50%; margin-bottom: 14px; }
.dot.d { background: var(--moss); } .dot.l { background: var(--sprout); } .dot.s { background: var(--sun); }

/* Contact */
.contact { background: var(--moss-tint); border-radius: 24px; padding: clamp(28px, 5vw, 48px); margin-top: 8px; }
.contact p { margin: 10px 0 0; font-size: 1.0625rem; color: var(--ink-soft); }
.contact a.mail { font-size: clamp(1.25rem, 2.6vw, 1.625rem); font-weight: 600; letter-spacing: -0.01em; display: inline-block; margin-top: 16px; word-break: break-word; }

/* Footer */
footer { letter-spacing: 0.005em; border-top: 1px solid var(--hairline); padding-block: 36px 56px; color: var(--ink-soft); font-size: 0.875rem; margin-top: 56px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
footer a { color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--ink); }

/* Legal pages */
.doc { max-width: var(--measure); margin-inline: auto; padding-block: clamp(40px, 7vw, 80px) 24px; }
.doc h1 { font-size: clamp(2.25rem, 4.6vw, 3.25rem); line-height: 1.08; letter-spacing: -0.03em; }
.doc .meta { color: var(--ink-soft); margin: 14px 0 32px; font-size: 0.9375rem; }
.doc h2 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.015em; margin: 44px 0 10px; }
.doc p, .doc li { font-size: 1.0625rem; line-height: 1.65; }
.doc ul { padding-left: 1.25em; }
.doc li + li { margin-top: 6px; }
.summary { background: var(--paper); border: 1px solid var(--hairline); border-radius: 20px; padding: 20px 24px; }
.summary h2 { margin-top: 0; font-size: 1.125rem; }
.summary ul { margin: 10px 0 0; }

@media (max-width: 520px) {
  .nav { gap: 16px; font-size: 0.875rem; }
}
@media (prefers-reduced-transparency: reduce) {
  .bar { background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Thin edge where the sticky bar meets content: a soft fade, not a hard line */
.bar { border-bottom-color: color-mix(in srgb, var(--hairline) 70%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .pill, .pill:active { transition: opacity 120ms ease; transform: none; }
}
@media (prefers-contrast: more) {
  :root { --ink-soft: var(--ink); --hairline: currentColor; }
  .bar { background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .contact, .summary, .app { border: 1px solid var(--ink); }
}
@media print {
  .bar, footer nav { display: none; }
  .section { border: 0; }
}

/* Motto sign-off: Factum est, et ita est. A quiet line at the top of the footer, last word in gold */
.signoff-wrap { padding-bottom: 28px; }
.signoff { margin: 0; }
.signoff blockquote { margin: 0; }
.signoff p {
  margin: 0;
  font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600; text-transform: uppercase;
  font-size: 1.375rem; line-height: 1.1; letter-spacing: 0.04em; color: var(--ink);
}
.signoff .gold { color: var(--gold); }
.signoff figcaption {
  font-family: "Jost", var(--text); font-weight: 500; text-transform: uppercase;
  font-size: 0.6875rem; letter-spacing: 0.22em; color: var(--ink-soft);
  margin-top: 12px; padding-top: 12px; position: relative;
}
.signoff figcaption::before { content: ""; position: absolute; top: 0; left: 0; width: 32px; height: 1px; background: var(--gold); }

/* Easter egg: tap the gold "est." in the footer motto and the head of quality control pops up.
   CSS only (checkbox + labels), so the strict no-script CSP stays as it is. */
.duck-toggle { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap; }
.signoff label.gold { cursor: pointer; border-radius: 4px; -webkit-tap-highlight-color: transparent; }
.duck-toggle:focus-visible ~ .signoff-wrap label.gold { outline: 2px solid var(--gold); outline-offset: 3px; }
.duck-card {
  position: fixed; z-index: 40;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 212px; padding: 8px 8px 12px; cursor: pointer;
  background: var(--paper); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--hairline));
  border-radius: 20px; box-shadow: 0 18px 48px rgba(10, 14, 11, 0.22), 0 2px 6px rgba(10, 14, 11, 0.08);
  transform: translateY(calc(100% + 32px)) rotate(4deg); transform-origin: 85% 100%;
  visibility: hidden; opacity: 0;
  transition: transform 420ms cubic-bezier(0.34, 1.45, 0.64, 1), opacity 200ms ease, visibility 0s linear 420ms;
}
.duck-toggle:checked ~ .duck-card {
  transform: none; visibility: visible; opacity: 1;
  transition: transform 520ms cubic-bezier(0.34, 1.45, 0.64, 1), opacity 160ms ease, visibility 0s;
}
.duck-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; }
.duck-cap { display: block; margin-top: 10px; padding-inline: 4px; font-size: 0.8125rem; line-height: 1.35; color: var(--ink-soft); }
.duck-cap strong {
  display: block; margin-bottom: 2px; color: var(--ink);
  font-family: "Jost", var(--text); font-weight: 500; text-transform: uppercase;
  font-size: 0.6875rem; letter-spacing: 0.12em;
}
.duck-404 { margin: 40px 0 0; max-width: 240px; }
.duck-404 img { display: block; width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--hairline); }
.duck-404 figcaption { margin-top: 12px; font-size: 0.9375rem; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .duck-card, .duck-toggle:checked ~ .duck-card { transform: none; transition: opacity 160ms ease, visibility 0s linear 160ms; }
  .duck-toggle:checked ~ .duck-card { transition: opacity 160ms ease, visibility 0s; }
}
@media (prefers-contrast: more) { .duck-card { border-color: var(--ink); } }
@media print { .duck-card, .duck-toggle { display: none; } }
