/* ============================================================
   BerryBox LLC, berryboxdev.com
   Design language: "Calm Craft", the studio system shared with
   garretkeyhani.com and whenwiseapp.com (docs/02-DESIGN.md).
   Static at rest. One accent. No em-dashes.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #FAFAF8;
  --card: #FFFFFF;
  --ink: #111827;
  --ink-2: #4B5563;
  --ink-3: #6B7280;
  --accent: #008F76;
  --accent-ink: #0A6B5D;
  --band: #0A6B5D;
  --hairline: #E7E5DE;

  --font-serif: "Source Serif 4", ui-serif, Georgia, serif;
  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, ui-sans-serif, sans-serif;

  --shadow-card: 0 1px 2px rgb(17 24 39 / 0.06);
  --radius-card: 16px;
  --rail: 72rem;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { color-scheme: light; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
::selection { background: color-mix(in srgb, var(--accent) 18%, transparent); }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 3. Type ---------- */
h1, h2, h3 { text-wrap: balance; }
h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.005em;
}
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 1.2rem;
}
h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.25;
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
}
p { max-width: 65ch; color: var(--ink-2); }
p strong { color: var(--ink); }
.lede { font-size: 1.25rem; line-height: 1.6; }
.factline {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  max-width: none;
}
a { color: inherit; }

/* Links in link rows: always underlined, accent ink. */
.app__links a, .textlink, .footer__note a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.app__links a:hover, .textlink:hover, .footer__note a:hover { text-decoration-thickness: 2px; }
.app__links { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: 1.1rem; max-width: none; }

/* ---------- 4. Layout: bands & rail ---------- */
.rail {
  max-width: var(--rail);
  margin: 0 auto;
  padding-left: clamp(1.25rem, 4vw, 2rem);
  padding-right: clamp(1.25rem, 4vw, 2rem);
}
.band { padding-top: clamp(5rem, 10vh, 8rem); padding-bottom: clamp(5rem, 10vh, 8rem); }
.band--paper { background: var(--paper); }
.band--card { background: var(--card); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.band--teal { background: var(--band); }

/* ---------- 5. Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.7rem 1.6rem;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 1.0625rem; text-decoration: none;
  transition: background-color 150ms, border-color 150ms;
}
.btn--primary { background: var(--accent-ink); color: #FFFFFF; }
.btn--primary:hover { background: #08574B; }
.btn--secondary { background: var(--card); color: var(--ink); border-color: var(--hairline); }
.btn--secondary:hover { border-color: var(--ink-3); }
.btn--small { min-height: 42px; padding: 0.45rem 1.25rem; font-size: 1rem; }

.chip {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--hairline);
  background: var(--paper);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  white-space: nowrap;
}
.chip--live {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- 6. Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner {
  max-width: var(--rail); margin: 0 auto;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}
.nav__wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav__links { display: flex; align-items: center; gap: 1.7rem; }
.nav__links a:not(.btn) {
  text-decoration: none; font-size: 1.0625rem; font-weight: 500; color: var(--ink-2);
}
.nav__links a:not(.btn):hover { color: var(--ink); }

/* ---------- 7. Hero ---------- */
.hero { padding-top: clamp(4.5rem, 11vh, 8rem); }
.hero__inner > * { max-width: 46rem; }
.hero__inner .lede { margin-top: 1.4rem; }
.hero__actions {
  display: flex; align-items: center; gap: 1.5rem;
  margin-top: 2.2rem; flex-wrap: wrap;
}
.hero .factline { margin-top: 2.4rem; }

/* ---------- 8. The apps (the heart of the page) ----------
   Four alternating rows: copy and a real screen in a device frame.
   Everything visible at once, nothing behind a click. */
.sectionintro { margin-bottom: 3.5rem; }
.apps { display: grid; }
.app {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
}
.app + .app {
  border-top: 1px solid var(--hairline);
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
}
.apps > .app:last-child { padding-bottom: 0; }
.app--flip .app__copy { order: 2; }
.app--flip .app__visual { order: 1; }

.app__head { display: flex; align-items: center; gap: 1.1rem; }
.app__icon { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.app__what {
  color: var(--ink);
  font-weight: 500;
  font-size: 1.1875rem;
  margin-top: 1.1rem;
}
.app__copy > p:not(.factline):not(.app__what):not(.app__links) { margin-top: 0.9rem; }
.app__copy .factline { margin-top: 1.3rem; }
.app__visual { display: flex; justify-content: center; }

/* Device frame: matte near-black bezel, 55px outer radius (studio spec). */
.phone {
  background: #1D1F22;
  border-radius: 55px;
  padding: 13px;
  box-shadow:
    0 1px 2px rgb(17 24 39 / 0.06),
    0 24px 60px rgb(17 24 39 / 0.18),
    inset 0 0 0 1.5px rgb(255 255 255 / 0.09);
  width: min(320px, 100%);
}
/* Every screen ships at exactly 750x1625; aspect-ratio guards the frame
   against any future screenshot that drifts from that size. */
.phone > img { border-radius: 42px; aspect-ratio: 750 / 1625; object-fit: cover; }

/* ---------- 9. Teal band (the one peak) ---------- */
.band--teal { padding-top: clamp(4rem, 9vh, 6.5rem); padding-bottom: clamp(4rem, 9vh, 6.5rem); }
.band--teal__inner { text-align: center; }
.tealband__statement {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.25;
  color: #FFFFFF;
  max-width: 24em;
  margin: 0 auto;
  text-wrap: balance;
}
.tealband__sub {
  color: rgb(255 255 255 / 0.85);
  max-width: 46em;
  margin: 1.4rem auto 0;
  font-size: 1.0625rem;
}

/* ---------- 10. About ----------
   Prose left, the studio's particulars right: the four facts anyone verifying
   the company is looking for, set as a definition list rather than decoration. */
.about {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.about__copy p + p { margin-top: 1.1rem; }

.particulars {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.8rem 2rem;
  display: grid;
  gap: 1.25rem;
}
.particulars dt {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-3);
}
.particulars dd {
  margin: 0.15rem 0 0;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
}
.particulars dd a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.particulars dd a:hover { text-decoration-thickness: 2px; }

/* ---------- 11. Contact & footer ---------- */
.contact__inner { text-align: center; }
.contact .sectionintro { margin: 0 auto; }
.contact__actions {
  display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2.2rem;
}

.footer { background: var(--paper); border-top: 1px solid var(--hairline); }
.footer__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 2.2rem; padding-bottom: 2.2rem;
  font-size: 0.9375rem; color: var(--ink-3);
}
.footer p { color: var(--ink-3); font-size: 0.9375rem; }
.footer nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer nav a { color: var(--ink-2); text-decoration: none; }
.footer nav a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 12. Responsive: tablet ---------- */
@media (max-width: 1023.5px) {
  .app, .app--flip { grid-template-columns: 1fr; gap: 2.4rem; }
  /* Copy leads at every width; the flip is a desktop-only rhythm. */
  .app--flip .app__copy { order: 1; }
  .app--flip .app__visual { order: 2; }
  .app__visual { justify-content: flex-start; }
  .phone { width: min(290px, 100%); }
  .about { grid-template-columns: 1fr; gap: 2.6rem; }
  .particulars { max-width: 30rem; }
}

/* ============================================================
   Phones (<=719.5px). Desktop and tablet rendering are untouched
   by these rules. Same mobile doctrine as the studio's other sites:
   keep the generous rhythm, give the thumb real targets.
   ============================================================ */
@media (max-width: 719.5px) {
  /* Nav: wordmark plus the one pill, no hamburger for two anchors. */
  .nav__links a:not(.btn) { display: none; }
  .nav__wordmark { font-size: 1.25rem; white-space: nowrap; }
  .nav__links .btn--small { white-space: nowrap; min-height: 40px; padding: 0.35rem 1.05rem; font-size: 0.9375rem; }

  /* Hero: stacked actions, fact line broken onto its own lines. */
  .hero { padding-top: 3rem; }
  .hero__actions { gap: 1.1rem; margin-top: 1.8rem; }
  .hero .factline { margin-top: 2rem; }
  .factline__part { display: block; line-height: 1.9; }
  .factline__dot { display: none; }

  /* Apps: icon and name stack cleanly, phone centered under the copy. */
  .sectionintro { margin-bottom: 2.6rem; }
  .app__icon { width: 56px; height: 56px; border-radius: 12px; }
  .app__head { gap: 0.9rem; }
  h3 { font-size: 1.4rem; gap: 0.6rem; }
  .app__visual { justify-content: center; }
  .phone { width: min(280px, 100%); }
  .app__links { gap: 0.4rem 1.4rem; }
  .app__links a, .textlink { padding-top: 0.5rem; padding-bottom: 0.5rem; display: inline-block; }

  /* About: the particulars card stays comfortable at 320px. */
  .particulars { padding: 1.4rem 1.4rem; gap: 1.1rem; }

  /* Contact: full-width stacked actions. */
  .contact__actions { flex-direction: column; align-items: stretch; gap: 0.8rem; }
  .contact__actions .btn { width: 100%; }

  /* Footer: centered, padded targets. */
  .footer__inner { flex-direction: column; text-align: center; gap: 1rem; }
  .footer nav { justify-content: center; gap: 0.4rem; }
  .footer nav a { padding: 0.6rem 0.7rem; }
}

/* ---------- 13. Print ---------- */
@media print {
  .nav, .skip-link, .contact__actions button { display: none; }
  .band--teal { background: #FFFFFF; }
  .tealband__statement, .tealband__sub { color: #000000; }
  * { box-shadow: none !important; }
}
