/* =====================================================================
   Sparrow & Spool site stylesheet
   One shared file across all pages. CSS variables for tokens, plain
   selectors for components. No build step, no JS.
   ===================================================================== */

:root {
  /* Colors */
  --bg: #F8F5EF;
  --surface: #FFFFFF;
  --text: #1A1814;
  --text-soft: #4A453E;
  --text-muted: #6B6258;
  --rule: #E5DFD3;
  --rule-strong: #C9C0AE;
  --accent: #1F3A5F;
  --accent-hover: #14294A;
  --accent-soft: #E6ECF4;
  --emphasis: #B5563A;

  /* Type */
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;

  /* Sizes */
  --measure-prose: 38rem;     /* ~640px reading width */
  --measure-section: 60rem;   /* ~960px hero / grid width */

  /* Rhythm: multiples of 0.5rem */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;
  --s-24: 6rem;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.2;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0;
}

p {
  margin: 0 0 var(--s-4);
}

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

a:hover {
  color: var(--accent-hover);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--s-12) 0;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Small caps marker used for section labels. Gives the "editorial" feel
   without ALL CAPS shouting. */
.label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-3);
}

/* Inline emphasis. Used VERY rarely. Reserved for one phrase per page. */
.emph {
  color: var(--emphasis);
  font-style: italic;
}

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

.container {
  width: 100%;
  max-width: var(--measure-section);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.prose {
  max-width: var(--measure-prose);
}

.prose h2 {
  margin-top: var(--s-12);
  margin-bottom: var(--s-4);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.prose ul,
.prose ol {
  margin: 0 0 var(--s-4);
  padding-left: var(--s-6);
}

.prose li + li {
  margin-top: var(--s-2);
}

.prose strong {
  color: var(--text);
}

.prose h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  margin-top: var(--s-6);
  margin-bottom: var(--s-3);
  color: var(--text);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-4) 0 var(--s-6);
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  border: 1px solid var(--rule);
  padding: var(--s-2) var(--s-3);
  text-align: left;
  vertical-align: top;
  color: var(--text-soft);
}

.prose th {
  color: var(--text);
  background: var(--bg);
  font-weight: 600;
}

.prose td.yn {
  text-align: center;
  white-space: nowrap;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--s-10) 0;
}

.prose .legal-aside {
  font-style: italic;
}

.prose .legal-attribution {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: var(--s-12);
}

/* --------------------------------------------------------------------
   Site header
   -------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: var(--s-6);
  padding-bottom: var(--s-6);
  gap: var(--s-6);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.005em;
}

.brand:hover {
  color: var(--text);
}

.brand .amp {
  color: var(--emphasis);
  font-style: italic;
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: var(--s-6);
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------
   Site footer
   -------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--s-24);
  padding: var(--s-10) 0 var(--s-12);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer__links {
  display: flex;
  gap: var(--s-6);
}

/* --------------------------------------------------------------------
   Boxfit brand mark + wordmark
   Used on the /boxfit page hero and the studio landing's app card.
   Wordmark uses Poppins SemiBold (loaded via Google Fonts) to match the
   brand sheet; falls back to system sans if the font fails to load.
   -------------------------------------------------------------------- */

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  text-decoration: none;
  color: inherit;
}

.brand-mark__symbol {
  flex: 0 0 auto;
}

.brand-mark__wordmark {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-mark__box {
  color: #2E2A26;
}

.brand-mark__fit {
  color: #C9613D;
}

/* Hero-scale: matches the existing hero__title size visually. */
.brand-mark--hero .brand-mark__symbol {
  width: clamp(56px, 7vw, 80px);
  height: auto;
}

.brand-mark--hero .brand-mark__wordmark {
  font-size: clamp(2.5rem, 5.5vw, 3.5rem);
}

/* Small (card-scale): for the studio landing's Boxfit card header. */
.brand-mark--small .brand-mark__symbol {
  width: 36px;
  height: auto;
}

.brand-mark--small .brand-mark__wordmark {
  font-size: 1.5rem;
}

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

.hero {
  padding: var(--s-20) 0 var(--s-16);
}

.hero__title {
  margin-bottom: var(--s-3);
}

.hero__tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  line-height: 1.3;
  color: var(--text);
  font-style: italic;
  margin-bottom: var(--s-6);
  max-width: var(--measure-prose);
}

.hero__intro {
  max-width: var(--measure-prose);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-soft);
  margin-bottom: var(--s-8);
}

.hero__actions {
  display: flex;
  gap: var(--s-4);
  align-items: center;
  flex-wrap: wrap;
}

.hero__meta {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------
   Button: primary CTA
   -------------------------------------------------------------------- */

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: 2px;
  text-decoration: none;
  transition: background-color 120ms ease;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-hover);
  color: #fff;
}

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

section {
  padding: var(--s-12) 0;
}

.section-title {
  margin-bottom: var(--s-8);
  max-width: var(--measure-prose);
}

.section-title h2 {
  margin-bottom: var(--s-3);
}

.section-title p {
  color: var(--text-soft);
  margin: 0;
}

/* --------------------------------------------------------------------
   Feature list: numbered, editorial
   -------------------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-8);
  max-width: var(--measure-prose);
}

.feature {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--s-6);
  align-items: baseline;
}

.feature__num {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding-top: 0.2rem;
}

.feature__title {
  margin-bottom: var(--s-2);
}

.feature__body {
  color: var(--text-soft);
  margin: 0;
}

/* --------------------------------------------------------------------
   App card: used on the studio landing
   -------------------------------------------------------------------- */

.apps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  max-width: var(--measure-prose);
}

.app-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s-8);
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms ease, transform 200ms ease;
}

.app-card:hover {
  border-color: var(--rule-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.app-card__name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: var(--s-2);
  color: var(--text);
}

.app-card__pitch {
  color: var(--text-soft);
  margin-bottom: var(--s-4);
}

.app-card__more {
  color: var(--accent);
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------
   Screenshot placeholder
   Looks intentional even without the real image. When the user provides
   PNGs, they swap in via <img src="/assets/...">.
   -------------------------------------------------------------------- */

.screenshot {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0;
  margin: var(--s-8) 0;
  overflow: hidden;
}

.screenshot img {
  display: block;
  width: 100%;
}

.screenshot__placeholder {
  aspect-ratio: 16 / 10;
  background-image:
    linear-gradient(135deg, transparent 49.5%, var(--rule) 49.5%, var(--rule) 50.5%, transparent 50.5%),
    linear-gradient(45deg, transparent 49.5%, var(--rule) 49.5%, var(--rule) 50.5%, transparent 50.5%);
  background-size: 16px 16px;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.screenshot__caption {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------- */

.pricing {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  max-width: var(--measure-prose);
}

.price {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s-6);
}

.price__amount {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  margin-bottom: var(--s-1);
}

.price__period {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--s-3);
}

.price__note {
  color: var(--text-soft);
  font-size: 0.9375rem;
  margin: 0;
}

/* --------------------------------------------------------------------
   Support / contact block
   -------------------------------------------------------------------- */

.support {
  max-width: var(--measure-prose);
}

.support p {
  color: var(--text-soft);
}

/* --------------------------------------------------------------------
   Legal pages: privacy, terms
   -------------------------------------------------------------------- */

.legal-header {
  padding: var(--s-16) 0 var(--s-8);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s-12);
}

.legal-header h1 {
  margin-bottom: var(--s-3);
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.legal section {
  padding: 0;
  margin-bottom: var(--s-12);
}

.legal section h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--rule);
}

.legal section .placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* --------------------------------------------------------------------
   Mobile tweaks
   -------------------------------------------------------------------- */

@media (max-width: 640px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
    padding-top: var(--s-4);
    padding-bottom: var(--s-4);
  }

  .site-nav {
    gap: var(--s-4);
  }

  .hero {
    padding: var(--s-12) 0 var(--s-8);
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .feature {
    grid-template-columns: 2rem 1fr;
    gap: var(--s-3);
  }
}
