/* ==========================================================================
   Everpine Apps — stylesheet
   Plain CSS · no JavaScript · system fonts only (no external font requests).
   Editorial minimalist system: serif display + system sans, evergreen palette.
   ========================================================================== */

:root {
  /* ---- Evergreen palette (light) ---- */
  --pine-900: #0f231a;
  --pine-800: #16241c;
  --pine-700: #1e3a2e;
  --pine-600: #245640;
  --pine-500: #2f6b52;
  --sage-500: #4f8467;
  --sage-400: #6f9e83;
  --sage-300: #9fcbb0;

  --paper:        #f4f2ea;   /* warm bone background */
  --paper-2:      #efece1;
  --surface:      #fffef9;   /* raised cards */
  --ink:          #16241c;   /* headings */
  --body:         #384339;   /* body text */
  --muted:        #5c675e;   /* secondary / labels */
  --hairline:     #ded9ca;
  --hairline-2:   #e8e4d8;

  --accent:       #245640;
  --accent-hover: #2f6b52;

  --grain-opacity: 0.05;
  --glow-1: rgba(79, 132, 103, 0.20);
  --glow-2: rgba(47, 107, 82, 0.14);

  /* ---- Type ---- */
  --serif: ui-serif, Georgia, "Times New Roman", Times, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
           Arial, "Noto Sans", sans-serif;
  --mono:  ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
           "Liberation Mono", monospace;

  /* ---- Scale ---- */
  --maxw: 64rem;
  --measure: 40rem;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 35, 26, 0.05);
  --shadow:    0 2px 6px rgba(15, 35, 26, 0.06), 0 18px 40px -22px rgba(15, 35, 26, 0.30);
  --shadow-lg: 0 6px 14px rgba(15, 35, 26, 0.08), 0 30px 60px -28px rgba(15, 35, 26, 0.42);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0c1510;
    --paper-2:    #0f1a13;
    --surface:    #13201a;
    --ink:        #eef3ec;
    --body:       #c4d0c6;
    --muted:      #8ea094;
    --hairline:   #223228;
    --hairline-2: #1b2820;

    --accent:       #a7d6ba;
    --accent-hover: #c2e6cf;

    --grain-opacity: 0.045;
    --glow-1: rgba(79, 132, 103, 0.16);
    --glow-2: rgba(31, 58, 46, 0.42);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 2px 8px rgba(0, 0, 0, 0.4), 0 24px 50px -26px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 8px 18px rgba(0, 0, 0, 0.5), 0 36px 70px -30px rgba(0, 0, 0, 0.8);
  }
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.22vw, 1.08rem);
  line-height: 1.65;
  color: var(--body);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Atmospheric background (glow + grain, no external assets) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg::before {
  content: "";
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(46rem 40rem at 82% -8%, var(--glow-1), transparent 62%),
    radial-gradient(40rem 40rem at -10% 6%, var(--glow-2), transparent 58%),
    radial-gradient(30rem 30rem at 60% 118%, var(--glow-1), transparent 60%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.65rem 1.1rem;
  background: var(--accent);
  color: var(--paper);
  border-radius: 0 0 var(--radius-sm) 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline-2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: block;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.brand__name {
  font-family: var(--serif);
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.site-nav ul {
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 1.6rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.35rem 0.1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
}
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--accent);
}

/* ---------- Main ---------- */
main { display: block; }

/* Eyebrow / kicker */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-500);
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
@media (prefers-color-scheme: dark) {
  .eyebrow { color: var(--sage-300); }
}

/* Hero */
.hero {
  padding-top: clamp(3.5rem, 9vw, 7rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  font-weight: 550;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease), gap 0.2s var(--ease);
}
.backlink:hover { color: var(--accent); gap: 0.7rem; }

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.9rem, 1.9rem + 4.6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero .lead {
  margin: 1.5rem 0 0;
  max-width: 34ch;
  font-size: clamp(1.15rem, 1.02rem + 0.7vw, 1.5rem);
  line-height: 1.45;
  color: var(--body);
  font-weight: 400;
}
.hero--app .lead { max-width: 40ch; }
.hero-status { margin: 1.9rem 0 0; }
.hero-404 { padding-bottom: clamp(4rem, 12vw, 8rem); }
.hero-404 .actions { margin-top: 2rem; }
.hero-404 .actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

/* Meta chips */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.meta li {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.34rem 0.7rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}

/* ---------- Editorial sections ---------- */
.section {
  padding-block: clamp(2.75rem, 6vw, 4.25rem);
  border-top: 1px solid var(--hairline-2);
}
.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 3rem;
}
@media (min-width: 48rem) {
  .section-grid {
    grid-template-columns: 14rem 1fr;
    gap: 0 3.5rem;
  }
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}
.section-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sage-500);
  letter-spacing: 0.05em;
}
@media (prefers-color-scheme: dark) {
  .section-num { color: var(--sage-400); }
}
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-body {
  max-width: var(--measure);
}
.section-body > p { margin: 0 0 1.1rem; }
.section-body > p:last-child { margin-bottom: 0; }
.section-body p {
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent-hover); }

.note {
  margin-top: 1.25rem !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  color: var(--muted);
  padding-left: 1rem;
  border-left: 2px solid var(--hairline);
}

/* ---------- Feature card (app) ---------- */
.feature-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: clamp(1.35rem, 3.5vw, 1.9rem);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
              border-color 0.3s var(--ease);
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--sage-400) 55%, var(--hairline));
}
.feature-card__glyph {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--sage-500);
  background: color-mix(in srgb, var(--sage-400) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--sage-400) 30%, transparent);
}
@media (prefers-color-scheme: dark) {
  .feature-card__glyph { color: var(--sage-300); }
}
.feature-card__glyph svg { width: 1.6rem; height: 1.6rem; }
.feature-card__body { flex: 1; min-width: 0; }
.feature-card__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.feature-card__name {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.feature-card__desc {
  display: block;
  color: var(--body);
  font-size: 1.02rem;
  line-height: 1.6;
}
.feature-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
}
.feature-card__cta svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.28s var(--ease);
}
.feature-card:hover .feature-card__cta svg { transform: translateX(4px); }

/* ---------- Status pill ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--sage-500);
  padding: 0.22rem 0.65rem 0.22rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sage-400) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--sage-400) 28%, transparent);
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  .status-pill { color: var(--sage-300); }
}
.status-pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--sage-400);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage-400) 25%, transparent);
}
.status-pill--lg { font-size: 0.82rem; padding: 0.3rem 0.8rem 0.3rem 0.65rem; }

/* ---------- Contact ---------- */
.contact-line {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem) !important;
  line-height: 1.2 !important;
}
.contact-line a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid color-mix(in srgb, var(--sage-400) 55%, transparent);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.contact-line a:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--hairline-2);
  padding-block: 2.5rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-inner .brand__name { font-size: 1rem; }
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-footer a:hover { color: var(--accent); }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}
.footer-mark { width: 22px; height: 22px; border-radius: 6px; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
