/* ---------------------------------------------------------------------------
   tray.benbasha.com - "cream, bottle green, apricot" web identity for Tray.
   Light-FIRST (the app is used in daylight; SPEC-DESIGN.md §2), with a dark
   variant via prefers-color-scheme. Every token below is copied verbatim from
   SPEC-DESIGN.md §3 - do not invent shades here.
   Type per §4: Outfit (display) + Inter (body) for Latin, Heebo for Hebrew.
   Page skeleton follows the fleet sites (sticky header, two-col hero, feature
   grid, pricing card, final CTA, footer) + shared legal-doc pages.
   No emoji anywhere: all icons are drawn inline SVG (§9 icon set).
--------------------------------------------------------------------------- */

:root {
  /* Light is primary (SPEC-DESIGN §3 - cream, bottle green, apricot). */
  --bg: #FAF6EE;
  --surface: #FFFFFF;
  --surface-alt: #F1EBDD;
  --ink: #1F2A22;
  --ink-soft: #5E6A61;
  --ink-faint: #66726A;
  --accent: #2F7D5B;
  --accent-soft: #DDEFE4;
  --on-accent: #FFFFFF;
  --due: #E88A3C;
  --due-soft: #FBE9D9;
  --missed: #B8472F;
  --missed-soft: #F8E1DC;
  --pro: #8C671C;
  --line: #E6DFD0;
  --glow: rgba(232, 138, 60, 0.35);

  --shadow-soft: 0 8px 24px rgba(31, 42, 34, 0.07);
  --shadow-lift: 0 18px 44px rgba(31, 42, 34, 0.13);
  /* The tray floor reads as a recess, not a card (§5a). */
  --recess: inset 0 2px 5px rgba(31, 42, 34, 0.07);

  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-card: 22px;
  --radius-button: 16px;
  --content: 1080px;
}

/* Hebrew: Heebo for display AND body - Outfit has no Hebrew (§4). */
:root:lang(he) {
  --font-display: 'Heebo', system-ui, -apple-system, sans-serif;
  --font: 'Heebo', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161A17;
    --surface: #1F2521;
    --surface-alt: #2A312C;
    --ink: #F3F1EA;
    --ink-soft: #B4BBB4;
    --ink-faint: #8A938B;
    --accent: #4FB07F;
    --accent-soft: #213A2E;
    --on-accent: #101512;
    --due: #F09A50;
    --due-soft: #3D2C1E;
    --missed: #E06A58;
    --missed-soft: #3A221F;
    --pro: #D9A64A;
    --line: #2E3630;

    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.5);
    --recess: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Times and counts are always tabular - a tray count must not shift (§4). */
.num { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.4px;
  margin: 0;
}

a { color: inherit; }

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

.wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------- brand --------------------------------- */
/* The mark is the app icon itself - the organizer grid with one apricot
   compartment open (assets/icon.png, the shipped icon from `assets/images`). */

.mark {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  /* The icon's own ground is cream, so it needs an edge on a cream page. */
  border: 1px solid var(--line);
}

.mark-lg {
  width: 78px;
  height: 78px;
  border-radius: 21px;
  box-shadow: var(--shadow-soft);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand .mark { width: 38px; height: 38px; }

.brand strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.5px;
}

.header-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
  font-weight: 600;
}

.header-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

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

.lang-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 13px;
  background: var(--surface);
}

.lang-switch:hover { border-color: var(--accent); }

/* ----------------------------- store badges ------------------------------ */

.store-badges {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 56px;
  padding: 0 22px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.store-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.store-badge svg { width: 25px; height: 25px; flex: none; fill: currentColor; }

.store-badge .badge-copy { display: flex; flex-direction: column; line-height: 1.12; }
.store-badge .badge-copy small { font-size: 11px; font-weight: 500; opacity: 0.82; }
.store-badge .badge-copy strong { font-size: 17px; font-weight: 700; }

/* --------------------------------- hero ---------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 64px;
}

/* The apricot "due" glow - only ever a glow, never a fill (§3). */
.hero::before {
  content: '';
  position: absolute;
  inset: -34% -10% auto -10%;
  height: 660px;
  background: radial-gradient(58% 58% at 68% 4%, var(--glow), transparent 68%);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

/* Background positions are not mirrored by `direction` - mirror the glow so it
   still sits behind the organizer in RTL. */
:root:lang(he) .hero::before {
  background: radial-gradient(58% 58% at 32% 4%, var(--glow), transparent 68%);
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 52px;
  align-items: center;
}

.hero-copy > * {
  opacity: 0;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px 6px 10px;
}

:root:lang(he) .hero-kicker { padding: 6px 10px 6px 16px; }

.hero-kicker .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--due);
  box-shadow: 0 0 0 4px var(--due-soft);
  flex: none;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 60px);
  margin: 20px 0 16px;
}

.hero h1 mark {
  background: transparent;
  color: var(--accent);
}

.hero-lead {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 32em;
  margin: 0 0 26px;
}

.hero-note {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 18px 0 0;
}

/* ------------------------- the organizer mock (§5) ----------------------- */
/* Drawn in HTML + tokens so every string stays localizable and RTL-mirrored. */

.organizer {
  justify-self: center;
  width: min(330px, 84vw);
  opacity: 0;
  animation: rise 0.8s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

/* 5b. Week strip - 7 days x one routine, open / closed / missed. */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
}

.day .lid {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1.5px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day .lid svg { width: 55%; height: 55%; }

/* green = taken/closed, apricot = due/open now, terracotta = missed (§3). */
.day.closed .lid { background: var(--accent); }
.day.closed .lid svg { fill: none; stroke: var(--on-accent); stroke-width: 2.6; }
.day.open .lid { background: var(--due-soft); border-color: var(--due); }
.day.open .lid svg { fill: var(--due); }
.day.missed .lid { background: var(--missed-soft); border-color: var(--missed); }
.day.open { color: var(--ink); }

/* 5a. The tray - a recess holding today's routine. */
.tray {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px 20px 22px;
  box-shadow: var(--shadow-lift);
}

/* The routine that is due now gets the apricot rim + glow (§3, §5a). */
.tray.due {
  border-color: var(--due);
  box-shadow: var(--shadow-lift), 0 0 0 4px var(--due-soft), 0 12px 38px var(--glow);
}

.tray-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.tray-head h3 { font-size: 22px; }

.tray-head .count {
  font-size: 15px;
  color: var(--ink-soft);
  margin-inline-start: auto;
}

.tray-chip {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  /* due-soft fill ALWAYS with ink text - white on apricot is 2.6:1 (§3). */
  background: var(--due-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 11px;
}

.tray-floor {
  background: var(--surface-alt);
  border-radius: 15px;
  box-shadow: var(--recess);
  padding: 8px 12px;
}

.pill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  font-size: 16px;
}

.pill-row + .pill-row { border-top: 1px solid var(--line); }

.pill-row svg { width: 26px; height: 26px; flex: none; }

.pill-row .qty {
  margin-inline-start: auto;
  font-size: 13px;
  color: var(--ink-faint);
}

.take-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
  height: 52px;
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.take-all svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; }

/* -------------------------------- features ------------------------------- */

.features { padding: 34px 0 60px; }

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 10px;
  text-align: center;
}

.section-sub {
  color: var(--ink-soft);
  margin: 0 auto 42px;
  max-width: 40em;
  font-size: 18px;
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px 26px 30px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.feature:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}

.feature .icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 15px;
  margin-bottom: 18px;
}

/* §9: 1.75px stroke UI icons. */
.feature .icon svg {
  width: 27px;
  height: 27px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The refill row is the one Pro feature on the grid - brass, not green. */
.feature.pro .icon { background: color-mix(in srgb, var(--pro) 14%, transparent); }
.feature.pro .icon svg { stroke: var(--pro); }
.feature.pro:hover { border-color: var(--pro); }

.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }

.feature .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--pro);
  margin-bottom: 6px;
}

/* ------------------------------- free/iap -------------------------------- */

.pricing { padding: 22px 0 76px; }

.pricing .wrap { max-width: 760px; }

.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px 34px 38px;
  text-align: center;
}

.price-card h2 { font-size: clamp(26px, 3.6vw, 34px); margin-bottom: 10px; }

.price-card .price-lead { color: var(--ink-soft); margin: 0 auto 24px; max-width: 34em; }

.price-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: start;
  margin-top: 8px;
}

.price-col {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 20px 22px 22px;
}

.price-col.premium { border-color: color-mix(in srgb, var(--pro) 45%, transparent); }

.price-col h4 { font-size: 17px; margin: 0 0 4px; }
.price-col .tag { font-size: 13px; font-weight: 700; color: var(--accent); }
.price-col.premium .tag { color: var(--pro); }

.price-col ul { margin: 10px 0 0; padding: 0; list-style: none; }

.price-col li {
  position: relative;
  padding-inline-start: 24px;
  margin: 8px 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.price-col li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  width: 13px;
  height: 7px;
  border-inline-start: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.price-col.premium li::before { border-color: var(--pro); }

.price-note {
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink-faint);
}

/* ------------------------------- final cta ------------------------------- */

.final-cta {
  text-align: center;
  padding: 8px 0 96px;
}

.final-cta .mark { margin: 0 auto 26px; }

.final-cta h2 {
  font-size: clamp(30px, 4.5vw, 44px);
  margin-bottom: 24px;
  max-width: 16em;
  margin-inline: auto;
}

.final-cta .store-badges { justify-content: center; }

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

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  padding: 42px 0 50px;
}

.site-footer .wrap { display: grid; gap: 10px; }

.site-footer a { color: var(--ink); text-decoration-color: var(--line); }

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  margin-bottom: 8px;
}

.footer-brand .mark { width: 30px; height: 30px; border-radius: 9px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-weight: 600;
}

/* ------------------------------ legal pages ------------------------------ */

.legal-main { padding: 40px 0 80px; }
.legal-main .wrap { max-width: 760px; }

.legal-doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px 40px 44px;
}

.legal-doc h1 { font-size: 34px; margin-bottom: 4px; }

.legal-doc .effective {
  color: var(--ink-faint);
  font-size: 14px;
  margin: 0 0 24px;
}

.legal-doc h2 {
  font-size: 21px;
  margin: 34px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.legal-doc h3 { font-size: 17px; margin: 22px 0 6px; }

.legal-doc p, .legal-doc li { color: var(--ink-soft); }
.legal-doc strong { color: var(--ink); }
.legal-doc ul { padding-inline-start: 22px; }

.legal-doc a {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.legal-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 4px;
  font-size: 15px;
}

.legal-doc th, .legal-doc td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: start;
  color: var(--ink-soft);
  vertical-align: top;
  /* Long strings (policy URLs, SDK names) must break, not widen the page. */
  overflow-wrap: anywhere;
}

.legal-doc th { background: var(--surface-alt); color: var(--ink); font-weight: 600; }

.callout {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin: 18px 0 4px;
}

.callout, .callout strong, .callout p { color: var(--ink); }
.callout p { margin: 0; }

/* ------------------------------- support --------------------------------- */

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 30px 34px 32px;
  margin-bottom: 22px;
  text-align: center;
}

.contact-card h2 { font-size: 24px; margin-bottom: 8px; }
.contact-card p { color: var(--ink-soft); margin: 0 auto 20px; max-width: 34em; }

.mail-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 26px;
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.mail-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.mail-button svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------- responsive ------------------------------ */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .organizer { order: -1; }
  .feature-grid { grid-template-columns: 1fr; }
  .price-cols { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .legal-doc { padding: 26px 22px 32px; }
  .header-nav { gap: 12px; font-size: 14px; }
  .header-nav .hide-sm { display: none; }
  /* The three-column tables cannot fit a phone at their natural width, so cap
     them to the container and let the cells wrap instead of scrolling the page
     sideways (verified at 390px). */
  .legal-doc table { table-layout: fixed; width: 100%; font-size: 13.5px; }
  .legal-doc th, .legal-doc td { padding: 8px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .organizer { animation: none; opacity: 1; }
}
