/* ==========================================================================
   scetto Coffeè Café · Cairo — design tokens, base and layout
   Direction: a roastery's order desk. Cream paper, espresso ink, and amber
   reserved for the one main action on each view. Product pictures sit on the
   page without boxes; the order ticket (cart) and offer tickets are the
   memorable pieces. Layout uses logical properties so an RTL Arabic version
   can be added later.
   ========================================================================== */

:root {
  /* Brand palette */
  --espresso: #281812;
  --dark-roast: #3A241B;
  --coffee: #70432D;
  --caramel: #A9673F;
  --amber: #E9A13B;
  --cream: #FFF7EB;
  --beige: #EAD5B9;
  --white: #FFFFFF;
  --muted: #6F6055;   /* 5.0:1 on the paper tone (was 4.46:1) */

  /* Derived */
  --amber-hover: #F2B454;
  --amber-press: #D78F27;
  --paper: color-mix(in srgb, var(--cream) 58%, var(--beige));   /* ticket stock */
  --cream-deep: color-mix(in srgb, var(--cream) 70%, var(--beige));
  --line: color-mix(in srgb, var(--espresso) 15%, transparent);
  --line-strong: color-mix(in srgb, var(--espresso) 32%, transparent);
  --on-dark: var(--cream);
  --on-dark-muted: color-mix(in srgb, var(--cream) 72%, transparent);
  --focus: var(--espresso);

  /* Type */
  --font-display: 'Young Serif', 'Charter', 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-docket: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --fs-display: clamp(2.9rem, 1.2rem + 6.6vw, 6.4rem);
  --fs-h1: clamp(2.4rem, 1.4rem + 3.8vw, 4.6rem);
  --fs-h2: clamp(1.85rem, 1.25rem + 2.3vw, 3.1rem);
  --fs-h3: clamp(1.3rem, 1.1rem + .7vw, 1.65rem);
  --fs-lead: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  --fs-sm: .9rem;
  --fs-xs: .8rem;

  /* Shape and space */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(56px, 8vw, 112px);
  --header-h: 72px;
  --shadow-soft: 0 1px 2px rgb(40 24 18 / .06), 0 10px 30px rgb(40 24 18 / .10);
  --shadow-lift: 0 2px 4px rgb(40 24 18 / .08), 0 18px 44px rgb(40 24 18 / .18);

  /* Paper grain (used on dark bands and under product photos) */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--subnav-h, 0px) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font: 400 1rem/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll { overflow: hidden; }

main { flex: 1 0 auto; display: block; }

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.012em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h4 { font-size: 1.15rem; line-height: 1.25; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 300;
  padding: .75rem 1.1rem;
  background: var(--espresso);
  color: var(--cream);
  border-radius: var(--r-sm);
  transform: translateY(-200%);
}
.skip-link:not(:focus) { clip-path: inset(50%); }
.skip-link:focus { transform: none; }

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), 1200px);
  margin-inline: auto;
}
.container--narrow { width: min(100% - 2 * var(--gutter), 860px); margin-inline: auto; }

.section { padding-block: var(--section-y); position: relative; }
.section--flush-top { padding-block-start: 0; }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }

.bg-cream { background: var(--cream); }
.bg-paper { background: var(--paper); }
.bg-beige { background: var(--beige); }
/* Muted text on beige and ticket stock needs a darker tone to keep 4.5:1 contrast. */
.bg-beige, .bg-paper { --muted: var(--muted-ink); }
.bg-espresso {
  background: var(--espresso);
  color: var(--on-dark);
  --focus: var(--amber);
  isolation: isolate;
}
.bg-espresso::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: .09;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}
.bg-roast { background: var(--dark-roast); color: var(--on-dark); --focus: var(--amber); }

.on-dark { --focus: var(--amber); }

.stack > * + * { margin-block-start: var(--stack, 1rem); }

/* Section heading row: the title plus a real piece of information or a link. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .75rem 2rem;
  margin-block-end: clamp(1.75rem, 3.5vw, 3rem);
}
.section-head__title { max-width: 18ch; }
.section-head__note { color: var(--muted); max-width: 38ch; margin: 0; }
.bg-espresso .section-head__note,
.bg-roast .section-head__note { color: var(--on-dark-muted); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  max-width: 54ch;
  color: color-mix(in srgb, var(--espresso) 82%, var(--cream));
}
.bg-espresso .lead, .bg-roast .lead { color: var(--on-dark-muted); }

.prose { max-width: 62ch; }
.prose p { font-size: 1.075rem; line-height: 1.75; }
.prose--serif p { font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); line-height: 1.6; }

.muted { color: var(--muted); }
.bg-espresso .muted, .bg-roast .muted { color: var(--on-dark-muted); }

.link {
  color: var(--coffee);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .22em;
  text-decoration-color: color-mix(in srgb, var(--coffee) 40%, transparent);
  transition: text-decoration-color .2s, color .2s;
}
.link:hover { color: var(--espresso); text-decoration-color: var(--amber); }
.bg-espresso .link, .bg-roast .link { color: var(--cream); text-decoration-color: color-mix(in srgb, var(--cream) 45%, transparent); }
.bg-espresso .link:hover, .bg-roast .link:hover { text-decoration-color: var(--amber); color: var(--cream); }

/* Page head used on inner pages */
.page-head { padding-block: clamp(32px, 4.5vw, 64px) clamp(20px, 3vw, 36px); }
.page-head__inner { display: grid; gap: 1.25rem; justify-items: start; }
.page-head__inner > * { max-width: 62rem; }
.page-head h1 { max-width: 16ch; font-size: clamp(2.3rem, 1.4rem + 3vw, 3.9rem); }
.page-head .eyebrow { margin-block-end: -.35rem; }

.breadcrumb { font-size: var(--fs-sm); color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; margin-block-end: 1.25rem; }
.breadcrumb a { color: var(--coffee); }

/* Test-clock banner (only shown when ?now= is used) */
.testclock {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 80;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: .55rem 1rem;
  background: var(--amber);
  color: var(--espresso);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.testclock button { background: var(--espresso); color: var(--cream); border: 0; border-radius: var(--r-pill); padding: .3rem .9rem; font-weight: 600; }

@media print {
  .announce, .site-header, .drawer, .drawer-backdrop, .toasts, .site-footer { display: none !important; }
}
