/* outofoffice. — design tokens, base elements and shared components */

/* Colour tokens are named by ROLE, not hue. Palette: "Positano" — white, sea blue, lemon,
   terracotta (taken from the hero photo). Never hard-code colours; add a token here instead. */
:root {
  color-scheme: light;
  --color-bg: #FFFFFF;            /* page background */
  --color-bg-glass: rgba(255, 255, 255, 0.92); /* sticky headers */
  --color-surface: #FFFFFF;       /* cards, inputs */
  --color-surface-2: #F3F7FB;     /* inset panels */
  --color-canvas: #F5F7FA;        /* app background behind cards (cool, never cream) */
  --color-glass: rgba(255, 255, 255, 0.72);  /* frosted cards over photos/gradients */
  --color-glass-strong: rgba(255, 255, 255, 0.86);
  --color-glass-edge: rgba(255, 255, 255, 0.65);
  --color-tape: rgba(220, 235, 250, 0.82); /* translucent sea-blue tape on polaroids */
  --color-ink: #13233A;           /* headings, body text */
  --color-on-ink: #FFFFFF;        /* text on ink (toasts, selected chips) */
  --color-body: #364760;          /* secondary paragraphs */
  --color-muted: #5B687B;         /* hints, captions */
  --color-primary: #1F6FD8;       /* buttons */
  --color-primary-hover: #185AB2;
  --color-primary-top: #2673DC;   /* top of the primary button gradient */
  --color-primary-glow: rgba(31, 111, 216, 0.30);
  --color-highlight: rgba(255, 255, 255, 0.22); /* inner top highlight on filled buttons */
  --color-link: #1A5FBA;          /* links, eyebrows */
  --color-on-primary: #FFFFFF;
  --color-accent: #E2725B;        /* decorative accent (wordmark period) */

  /* Surfaces & coral. RULE: coral is an ACCENT only (buttons, badges, small highlights) and is
     never a card/section background, and not a button fill on navy (too loud). Large surfaces are
     white, light sea-blue or deep navy; buttons on navy are white (.btn-light). */
  --color-sea: #EAF3FD;           /* light sea-blue surface */
  --color-navy: #13233A;          /* deep navy surface (hero CTA cards) */
  --color-on-navy: #FFFFFF;
  --color-on-navy-muted: #C5D3E6;
  --color-coral: #E2725B;         /* small highlights only: wordmark period, accents */
  --color-btn-on-navy: #FFFFFF;   /* buttons on navy cards: white with navy text */
  --color-btn-on-navy-hover: #EAF3FD;
  --color-on-navy-line: rgba(255, 255, 255, 0.18); /* dividers on navy */
  --color-on-navy-hover: rgba(255, 255, 255, 0.14); /* outline-button hover on navy/photos */
  --color-border: #DCE5EF;
  --color-border-soft: #E8EDF3;
  --color-border-strong: #B9C8DA;
  --color-hover: rgba(19, 35, 58, 0.06);
  --color-selected: #EEF5FE;
  --color-bubble: #EDF1F6;        /* friends' chat bubbles (blue = you) */
  --color-scrim: rgba(19, 35, 58, 0.45); /* modal backdrop */
  --color-photo-scrim: rgba(19, 35, 58, 0.78); /* gradient under text on photos */
  --color-photo-scrim-soft: rgba(19, 35, 58, 0.4);
  --color-error: #B42318;
  --color-error-soft: #FEF3F2;
  --color-error-border: #F5C2BC;

  /* Calendar / status tints, each with a readable "deep" text colour */
  --color-pto: #FBD9CF;           --color-pto-deep: #93351E;      /* terracotta: uses PTO */
  --color-off: #DCEBFA;           --color-off-deep: #1B4C88;      --color-off-soft: #F0F6FE; /* sea: day off */
  --color-holiday: #FFF0C2;       --color-holiday-deep: #6E5100;  /* lemon: holiday */
  --color-approved: #E7ECF2;      --color-approved-deep: #46536A;
  --color-demo: #FFF0C2;          --color-demo-deep: #6E5100;     --color-demo-soft: #FFF8E0;
  --color-hatch-a: #E3E8EE;       --color-hatch-b: #F5F7FA;
  --color-trip-band: rgba(226, 114, 91, 0.14);
  --color-trip-focus: #C6DCF5;
  --glow-1: rgba(220, 235, 250, 0.95);
  --glow-2: rgba(255, 240, 194, 0.75);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-hand: 'Kalam', 'Segoe Print', 'Bradley Hand', cursive; /* handwritten notes (landing) */

  --radius-sm: 10px;
  --radius-btn: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  /* Layered shadows: a 1px ring instead of borders, then soft ambient depth */
  --shadow-xs: 0 0 0 1px rgba(19, 35, 58, 0.07), 0 1px 2px rgba(19, 35, 58, 0.05);
  --shadow-sm: 0 0 0 1px rgba(19, 35, 58, 0.055), 0 1px 2px rgba(19, 35, 58, 0.04), 0 8px 20px -6px rgba(19, 35, 58, 0.08);
  --shadow: 0 0 0 1px rgba(19, 35, 58, 0.05), 0 2px 4px rgba(19, 35, 58, 0.04), 0 20px 44px -14px rgba(19, 35, 58, 0.20);
  --shadow-lg: 0 0 0 1px rgba(19, 35, 58, 0.04), 0 36px 72px -24px rgba(19, 35, 58, 0.34), 0 14px 28px -14px rgba(19, 35, 58, 0.14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1280px;
  --focus: 0 0 0 4px rgba(31, 111, 216, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--color-link); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.015em; text-wrap: balance; }
h1, h2, .serif { font-family: var(--font-serif); font-weight: 400; }
h1, h2 { letter-spacing: -0.012em; }
h3, h4 { font-weight: 700; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
p { margin: 0 0 1em; }
.muted { color: var(--color-muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-link);
  margin: 0 0 0.9rem;
}

/* ─── Wordmark: always lowercase, one word, with the period ─── */
.wordmark {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  font-size: 1.35rem;
  line-height: 1;
}
.wordmark .dot { color: var(--color-accent); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0.7em 1.3em;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  font-weight: 600; font-size: 0.96rem; line-height: 1.2; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: .08s; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--color-primary-top) 0%, var(--color-primary) 100%); color: var(--color-on-primary);
  box-shadow: inset 0 1px 0 var(--color-highlight), 0 1px 2px var(--color-primary-glow), 0 8px 20px -8px var(--color-primary-glow);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%); box-shadow: inset 0 1px 0 var(--color-highlight), 0 1px 2px var(--color-primary-glow), 0 12px 26px -8px var(--color-primary-glow); }
.btn-light { background: var(--color-btn-on-navy); color: var(--color-navy); box-shadow: 0 1px 2px rgba(19, 35, 58, 0.2), 0 8px 20px -8px rgba(19, 35, 58, 0.45); }
.btn-light:hover { background: var(--color-btn-on-navy-hover); }
.btn-outline-light { background: transparent; color: var(--color-on-navy); border-color: var(--color-on-navy); }
.btn-outline-light:hover { background: var(--color-on-navy-hover); }
.btn-secondary { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--color-ink); padding-inline: 0.8em; }
.btn-ghost:hover { background: var(--color-hover); }
.btn-danger { background: transparent; color: var(--color-error); border-color: var(--color-error-border); }
.btn-danger:hover { background: var(--color-error-soft); }
.btn-sm { min-height: 36px; padding: 0.45em 0.95em; font-size: 0.875rem; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 0.8em 1.6em; font-size: 1.04rem; border-radius: 14px; }
.btn-block { width: 100%; }

/* ─── Cards & surfaces ─── */
.card {
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .2s var(--ease);
}
a.card:hover, .card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card + .card { margin-top: 16px; }
/* Large surfaces are only white, light sea-blue or deep navy. Coral is never a surface. */
.surface-sea { background: var(--color-sea); border-color: transparent; }
.surface-navy { background: var(--color-navy); color: var(--color-on-navy); border-color: transparent; }
.surface-navy :is(h1, h2, h3, h4) { color: var(--color-on-navy); }
.surface-navy :is(p, .muted, .hint) { color: var(--color-on-navy-muted); }
.surface-navy a:not(.btn) { color: var(--color-on-navy); }

.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.18em 0.68em; border-radius: 999px;
  font-size: 0.74rem; font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: var(--color-approved); color: var(--color-ink);
}
.badge-sage { background: var(--color-off); color: var(--color-off-deep); }
.badge-rose { background: var(--color-pto); color: var(--color-pto-deep); }
.badge-lilac { background: var(--color-holiday); color: var(--color-holiday-deep); }
.badge-demo { background: var(--color-demo); color: var(--color-demo-deep); }

/* ─── Forms ─── */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 600; font-size: 0.92rem; }
.hint { font-size: 0.82rem; color: var(--color-muted); margin: 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 0.6em 0.9em;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-btn);
  box-shadow: 0 1px 2px rgba(19, 35, 58, 0.04);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:hover { border-color: var(--color-border-strong); }
.input:focus { border-color: var(--color-primary); box-shadow: var(--focus); outline: none; }
.input::placeholder { color: var(--color-muted); opacity: 0.8; }
.input[aria-invalid="true"] { border-color: var(--color-error); }
.error-text { color: var(--color-error); font-size: 0.86rem; margin: 4px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 12px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; min-width: 44px; padding: 0.35em 0.9em;
  border-radius: 999px; border: 1px solid transparent; box-shadow: var(--shadow-xs);
  background: var(--color-surface); cursor: pointer; font-weight: 500; font-size: 0.9rem;
  user-select: none; transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.chip:hover { box-shadow: var(--shadow-sm); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-on-ink); }
.chip:has(input:focus-visible) { box-shadow: var(--focus); }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--color-primary); flex: none; }

/* ─── Toast ─── */
.toast-wrap { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: var(--color-ink); color: var(--color-on-ink); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 0.92rem; pointer-events: auto; animation: toast-in .35s var(--ease-spring) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* ─── Scrapbook pieces: handwriting, polaroids, tape ─── */
.scribble { font-family: var(--font-hand); font-weight: 300; color: var(--color-ink); line-height: 1.12; letter-spacing: 0; }
.polaroid {
  position: relative; margin: 0; padding: 10px 10px 12px; background: var(--color-surface);
  border-radius: 4px; box-shadow: var(--shadow-lg);
}
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 2px; }
.polaroid figcaption { margin-top: 10px; font-size: 1.02rem; text-align: center; color: var(--color-body); }
/* strip of tape holding the polaroid on */
.polaroid::before {
  content: ''; position: absolute; top: -13px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-4deg);
  background: var(--color-tape); box-shadow: 0 1px 2px rgba(19, 35, 58, 0.08); border-radius: 2px;
}
.doodle { position: absolute; fill: none; stroke: var(--color-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Motion ─── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
/* Scroll reveal (landing): content is hidden only after JS marks the page, so it never stays invisible */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }
.toast.error { background: var(--color-error); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
