/* =============================================================================
   TOFFEHA — BASE
   Design tokens, element defaults, typography utilities, accessibility
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ---------------------------------------------------------------------------
   Design System Tokens
   --------------------------------------------------------------------------- */
:root {
  /* --- Colors: Brand --- */
  --brand:           #E11217;
  --brand-hover:     #C20E13;
  --brand-soft:      #FDECEC;

  /* --- Colors: Accent --- */
  --accent:          #1E66B0;
  --accent-soft:     #EAF2FB;

  /* --- Colors: Premium --- */
  --premium:         #C28A1C;
  --premium-soft:    #FBF2DF;

  /* --- Colors: Surface / Background --- */
  --bg:              #FBF6EE;
  --surface:         #FFFFFF;
  --surface-2:       #FDFAF4;
  --bg-sunken:       #F4EADB;

  /* --- Colors: Text --- */
  --text:            #0E2042;
  --text-muted:      #55657F;
  --text-subtle:     #7C8AA4;
  --text-link:       #18548F;
  --text-on-brand:   #FFFFFF;
  --text-on-dark:    #F7EFE2;

  /* --- Colors: Border --- */
  --border:          #E7DBC8;
  --border-strong:   #D6C8B1;

  /* --- Colors: Ink scale --- */
  --ink-900:         #0E2042;
  --ink-800:         #15294E;
  --ink-700:         #213760;
  --ink-300:         #8A9BB8;
  --ink-200:         #B8C4D4;

  /* --- Colors: Neutral palette --- */
  --ivory:           #FBF6EE;
  --paper:           #FFFFFF;
  --sand-100:        #F4EADB;
  --sand-200:        #EAD9C5;

  /* --- Colors: Semantic --- */
  --success-100:     #D6F5E3;
  --success-500:     #1A8A4A;
  --danger-500:      #C20E13;
  --azure-50:        #EAF2FB;
  --azure-700:       #1A4F8A;

  /* --- Typography: Families --- */
  --font-display:    "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans:       "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono:       "Space Mono", ui-monospace, monospace;

  /* --- Typography: Weights --- */
  --fw-regular:      400;
  --fw-medium:       500;
  --fw-semibold:     600;
  --fw-bold:         700;
  --fw-extrabold:    800;

  /* --- Typography: Size scale --- */
  --text-2xs:        0.6875rem;   /*  11px */
  --text-xs:         0.75rem;     /*  12px */
  --text-sm:         0.875rem;    /*  14px */
  --text-base:       1rem;        /*  16px */
  --text-md:         1.125rem;    /*  18px */
  --text-lg:         1.3125rem;   /*  21px */
  --text-xl:         1.625rem;    /*  26px */
  --text-2xl:        2.0625rem;   /*  33px */
  --text-3xl:        2.625rem;    /*  42px */
  --text-4xl:        clamp(2.75rem, 1.6rem + 4.6vw, 4.25rem);
  --text-5xl:        clamp(3.5rem,  1.5rem + 8vw,   6.5rem);

  /* --- Typography: Leading --- */
  --leading-tight:   1.06;
  --leading-snug:    1.18;
  --leading-normal:  1.5;
  --leading-relaxed: 1.68;

  /* --- Typography: Tracking --- */
  --tracking-tight:  -0.022em;
  --tracking-snug:   -0.012em;
  --tracking-label:   0.16em;

  /* --- Spacing --- */
  --space-1:         0.25rem;
  --space-2:         0.5rem;
  --space-3:         0.75rem;
  --space-4:         1rem;
  --space-5:         1.5rem;
  --space-6:         2rem;
  --space-7:         2.5rem;
  --space-8:         3rem;
  --space-9:         4rem;
  --space-10:        5rem;
  --space-11:        7rem;
  --space-12:        9rem;
  --gutter:          clamp(1.25rem, 4vw, 3rem);

  /* --- Layout: Containers --- */
  --container-sm:    640px;
  --container-md:    920px;
  --container-lg:    1140px;
  --container-xl:    1320px;

  /* --- Radii --- */
  --radius-xs:       6px;
  --radius-sm:       10px;
  --radius-md:       14px;
  --radius-lg:       20px;
  --radius-xl:       28px;
  --radius-2xl:      36px;
  --radius-pill:     999px;
  --radius-card:     var(--radius-lg);

  /* --- Shadows (navy-tinted) --- */
  --shadow-xs:       0 1px 2px rgba(14, 32, 66, 0.07);
  --shadow-sm:       0 2px 4px rgba(14, 32, 66, 0.07), 0 1px 2px rgba(14, 32, 66, 0.06);
  --shadow-md:       0 6px 16px rgba(14, 32, 66, 0.09), 0 2px 4px rgba(14, 32, 66, 0.06);
  --shadow-lg:       0 18px 40px rgba(14, 32, 66, 0.13), 0 4px 10px rgba(14, 32, 66, 0.07);
  --shadow-xl:       0 36px 80px rgba(14, 32, 66, 0.20), 0 8px 20px rgba(14, 32, 66, 0.09);
  --shadow-brand:    0 14px 34px rgba(225, 18, 23, 0.28);

  /* --- Glass --- */
  --glass-bg:        color-mix(in oklab, #FFFFFF 62%, transparent);
  --glass-bg-dark:   color-mix(in oklab, #0E2042 54%, transparent);
  --glass-border:    color-mix(in oklab, #FFFFFF 70%, transparent);
  --glass-blur:      18px;
  --glass-saturate:  1.4;
  --glass-shadow:    0 8px 32px rgba(14, 32, 66, 0.12);

  /* --- Gradients --- */
  --grad-sunrise:    linear-gradient(135deg, #E11217 0%, #E0561D 52%, #C28A1C 100%);
  --grad-azure:      linear-gradient(135deg, #1E66B0 0%, #128C7E 100%);
  --grad-ember:      linear-gradient(150deg, #720A0D 0%, #C20E13 48%, #E0561D 100%);
  --grad-paper:      linear-gradient(180deg, #FBF6EE 0%, #F5EEE2 100%);

  /* --- Motion --- */
  --dur-instant:     90ms;
  --dur-fast:        160ms;
  --dur-base:        240ms;
  --dur-slow:        420ms;
  --dur-slower:      680ms;

  --ease-entrance:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-standard:   cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-exit:       cubic-bezier(0.4, 0, 1, 1);

  --hover-lift:      -3px;
  --press-scale:     0.97;

  /* --- Z-index --- */
  --z-base:          0;
  --z-raised:        10;
  --z-sticky:        100;
  --z-overlay:       1000;
  --z-modal:         1100;
  --z-toast:         1200;

  /* --- Control heights --- */
  --control-h-sm:    36px;
  --control-h-md:    44px;
  --control-h-lg:    54px;
}

/* ---------------------------------------------------------------------------
   Box Model Reset
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
   HTML & Body
   --------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

/* ---------------------------------------------------------------------------
   Headings
   --------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-snug);
  color: var(--text);
  text-wrap: balance;
  margin-top: 0;
  margin-bottom: var(--space-3);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

/* ---------------------------------------------------------------------------
   Prose
   --------------------------------------------------------------------------- */
p {
  text-wrap: pretty;
  line-height: var(--leading-relaxed);
  margin-top: 0;
  margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------------------
   Links
   --------------------------------------------------------------------------- */
a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Media
   --------------------------------------------------------------------------- */
img,
picture,
video,
canvas,
svg {
  max-width: 100%;
  display: block;
}

/* ---------------------------------------------------------------------------
   Selection
   --------------------------------------------------------------------------- */
::selection {
  background: var(--brand-soft);
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   Focus
   --------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 55%, transparent);
  border-radius: 4px;
}

/* Interactive elements get focus ring */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 55%, transparent);
}

/* ---------------------------------------------------------------------------
   Typography Utilities
   --------------------------------------------------------------------------- */

/* Display — large editorial headings */
.t-display {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

/* Eyebrow — uppercase mono label */
.t-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

/* Price — monospaced bold numbers */
.t-price {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
}

/* Muted text */
.t-muted {
  color: var(--text-muted);
}

/* Subtle text */
.t-subtle {
  color: var(--text-subtle);
}

/* Brand color */
.t-brand {
  color: var(--brand);
}

/* Premium color */
.t-premium {
  color: var(--premium);
}

/* ---------------------------------------------------------------------------
   Accessibility
   --------------------------------------------------------------------------- */

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: var(--brand);
  color: var(--text-on-brand);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease-entrance);
}

.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}
