/* =========================================================
   Japonština s Míšou — colors_and_type.css
   Core design tokens: color, typography, spacing, radii, shadow.
   Load this ONCE at the root; everything downstream uses the vars.
   ========================================================= */

/* --- Webfonts (self-hosted in /fonts) ----------------------
   - Display/body sans → "Plus Jakarta Sans" (variable, latin + latin-ext)
   - Japanese companion → "Noto Sans JP" (subset to the characters used on the site)
   - Serif / hand tokens fall back to system fonts (not loaded).
   Regenerate with: python3 scripts/build_fonts.py
-------------------------------------------------------------- */
/* @font-face:begin (generated by scripts/build_fonts.py) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/plus-jakarta-sans-latin-ext-300-800.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/plus-jakarta-sans-latin-300-800.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/noto-sans-jp-all-400-900.woff2) format('woff2');
  unicode-range: U+3042, U+304b-304c, U+304f-3050, U+3057-3058, U+3063, U+3066-3067, U+306d, U+306f-3070, U+3088, U+308d, U+3093, U+3099, U+4e0a, U+4e2d, U+4f1a, U+521d, U+5546, U+58f2, U+5b8c, U+652f, U+6587, U+65c5, U+65e5, U+6642, U+66f8, U+672c, U+6f22, U+76f8, U+79c1, U+7d1a, U+884c, U+8a71, U+8a9e, U+8ac7, U+ff01;
}
/* @font-face:end */

:root {
  /* ===== COLOR: Raw palette ================================ */

  /* Violet — PRIMARY. Soft, pastel, friendly. */
  --violet-50:  #F6F1FC;
  --violet-100: #EDE2F8;
  --violet-200: #DCC7F0;
  --violet-300: #C7A8E6;   /* hero pastel */
  --violet-400: #B088DB;
  --violet-500: #9B6BD0;   /* primary brand */
  --violet-600: #7F4FB8;
  --violet-700: #63398F;
  --violet-800: #482766;
  --violet-900: #2F1A44;

  /* Orange / Coral — SECONDARY. Pulled from the ukiyo-e illustrations. */
  --orange-50:  #FEF4EE;
  --orange-100: #FDE6D6;
  --orange-200: #FBC9A7;
  --orange-300: #F6A876;
  --orange-400: #EE8B50;
  --orange-500: #BC501B;   /* brand action colour – torii red-orange, ≥4.5:1 with white text (WCAG AA) */
  --orange-600: #A14517;
  --orange-700: #863913;
  --orange-800: #6E2F15;
  --orange-900: #3F1B0C;

  /* Paper / Neutral — warm creamy whites → inky blacks */
  --paper-0:    #FFFFFF;
  --paper-50:   #FBF8F4;   /* page background — subtle warm tint */
  --paper-100:  #F5EFE6;   /* card / tile warm neutral */
  --paper-200:  #EBE3D5;
  --paper-300:  #D9CFBE;
  --paper-400:  #B8AB95;
  --paper-500:  #72695A;
  --paper-600:  #5F5648;
  --paper-700:  #3F392E;
  --paper-800:  #26221B;
  --paper-900:  #141210;   /* ink — body text on light bg */

  /* Accent — Sage (from illustrations). Tertiary, used sparingly. */
  --sage-100:   #E2ECE2;
  --sage-300:   #9DBFA2;
  --sage-500:   #5E8A6A;
  --sage-700:   #3C5C47;

  /* Semantic color roles ---------------------------------- */
  --bg:            var(--paper-50);
  --bg-raised:     var(--paper-0);
  --bg-sunken:     var(--paper-100);
  --bg-inverse:    var(--paper-900);

  --surface-1:     var(--paper-0);
  --surface-2:     var(--paper-100);
  --surface-3:     var(--violet-50);
  --surface-4:     var(--orange-50);

  --fg:            var(--paper-900);  /* body text */
  --fg-muted:      var(--paper-600);  /* secondary text */
  --fg-subtle:     var(--paper-500);  /* tertiary, captions */
  --fg-on-primary: var(--paper-0);
  --fg-on-dark:    var(--paper-50);
  --fg-inverse:    var(--paper-50);

  --border:        var(--paper-200);
  --border-strong: var(--paper-300);
  --border-focus:  var(--violet-500);

  --primary:            var(--violet-300);
  --primary-hover:      var(--violet-400);
  --primary-active:     var(--violet-500);
  --primary-bg-soft:    var(--violet-100);

  --secondary:          var(--orange-500);
  --secondary-hover:    var(--orange-600);
  --secondary-active:   var(--orange-700);
  --secondary-bg-soft:  var(--orange-100);

  --accent:             var(--sage-500);
  --accent-bg-soft:     var(--sage-100);

  --success:  #417650;
  --warning:  #D19A3A;
  --danger:   #B23B3B;
  --info:     var(--violet-500);

  /* ===== TYPOGRAPHY ======================================== */
  --font-sans:     'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif:    'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-jp:       'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  --font-hand:     'Caveat', 'Comic Sans MS', cursive;  /* hand-written accents, used very sparingly */
  --font-mono:     ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace;

  /* Type scale (1.25 modular scale, tuned) */
  --text-2xs:  0.6875rem;  /* 11px — tiny labels only */
  --text-xs:   0.75rem;    /* 12px — metadata */
  --text-sm:   0.875rem;   /* 14px — secondary UI */
  --text-base: 1rem;       /* 16px — body */
  --text-lg:   1.125rem;   /* 18px — large body / lead */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */
  --text-7xl:  4.5rem;     /* 72px — display */
  --text-8xl:  6rem;       /* 96px — huge hero */

  --leading-tight:   1.15;
  --leading-snug:    1.3;
  --leading-normal:  1.55;
  --leading-relaxed: 1.7;

  --tracking-tighter: -0.03em;
  --tracking-tight:   -0.015em;
  --tracking-normal:  0;
  --tracking-wide:    0.03em;
  --tracking-wider:   0.08em;
  --tracking-widest:  0.22em;     /* tiny caps eyebrows */

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-extrabold:800;

  /* ===== SPACING (4px base) ================================ */
  --space-0:   0;
  --space-1:   0.25rem;    /* 4  */
  --space-2:   0.5rem;     /* 8  */
  --space-3:   0.75rem;    /* 12 */
  --space-4:   1rem;       /* 16 */
  --space-5:   1.25rem;    /* 20 */
  --space-6:   1.5rem;     /* 24 */
  --space-8:   2rem;       /* 32 */
  --space-10:  2.5rem;     /* 40 */
  --space-12:  3rem;       /* 48 */
  --space-16:  4rem;       /* 64 */
  --space-20:  5rem;       /* 80 */
  --space-24:  6rem;       /* 96 */
  --space-32:  8rem;       /* 128 */

  /* ===== RADII (soft, pillow-like) ========================= */
  --radius-none: 0;
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   14px;     /* default card/input */
  --radius-lg:   22px;     /* large cards, hero tiles */
  --radius-xl:   32px;
  --radius-2xl:  48px;     /* huge hero panels, course tiles */
  --radius-pill: 999px;

  /* ===== SHADOW — soft, diffused, warm ===================== */
  --shadow-xs:  0 1px 2px rgba(63, 57, 46, 0.06);
  --shadow-sm:  0 2px 6px rgba(63, 57, 46, 0.08);
  --shadow-md:  0 6px 18px rgba(63, 57, 46, 0.10);
  --shadow-lg:  0 16px 40px rgba(63, 57, 46, 0.14);
  --shadow-xl:  0 28px 72px rgba(63, 57, 46, 0.18);

  /* Colored shadows for CTAs (subtle violet/orange glow) */
  --shadow-violet: 0 12px 28px -6px rgba(199, 168, 230, 0.55);
  --shadow-orange: 0 12px 28px -6px rgba(188, 80, 27, 0.35);

  /* ===== MOTION =========================================== */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);  /* soft overshoot */
  --dur-quick:   120ms;
  --dur-base:    220ms;
  --dur-slow:    420ms;
  --dur-entrance:620ms;

  /* ===== LAYOUT =========================================== */
  --container:   1200px;
  --container-narrow: 880px;
  --container-wide:   1440px;
}

/* ==========================================================
   SEMANTIC TYPOGRAPHY — set on elements directly.
   Hero and section labels follow the PDF's conventions:
   • Eyebrows are short lowercase letter-spaced words ("o mně", "f a q")
   • Display headlines are bold sans with a tight line-height
   • Body is Plus Jakarta Sans regular
   ========================================================== */

html {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  text-wrap: pretty;
}

/* Eyebrow — tiny widely-spaced, lowercase. The PDF uses this
   pattern repeatedly ("o mně", "f a q", "l e k c e"). */
.eyebrow,
[data-kind="eyebrow"] {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: lowercase;
  color: var(--orange-600);
  /* Rendered as letter-spaced lowercase, optionally with gaps */
}

/* Display headlines — large, tight, bold sans. */
h1, .h1 {
  font-family: var(--font-sans);
  font-size: clamp(var(--text-5xl), 6vw, var(--text-8xl));
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  text-wrap: balance;
  margin: 0;
}

h2, .h2 {
  font-family: var(--font-sans);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-6xl));
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  text-wrap: balance;
  margin: 0;
}

h3, .h3 {
  font-family: var(--font-sans);
  font-size: clamp(var(--text-2xl), 2.8vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  margin: 0;
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--fg);
  margin: 0;
}

h5, .h5 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}

/* Editorial serif — for long-form blog lead-ins and pull quotes */
.serif-display {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-style: italic;
  letter-spacing: var(--tracking-tight);
}

/* Hand-written accent (tiny, used for "tip" callouts or ":)" asides) */
.hand {
  font-family: var(--font-hand);
  font-weight: var(--weight-bold);
  color: var(--orange-600);
}

/* Japanese companion */
.jp {
  font-family: var(--font-jp);
  font-weight: var(--weight-medium);
}
.jp-display {
  font-family: var(--font-jp);
  font-weight: var(--weight-black, 900);
  color: var(--orange-500);
}

/* Orange heading emphasis → violet on hover (whole site) */
h1 em, h2 em, h3 em, h4 em, h5 em, h6 em,
.hero-jp-word, .hero h1 .jp-word,
.section-title em, .subtitle em {
  transition: color .25s var(--ease-out);
}
h1 em:hover, h2 em:hover, h3 em:hover, h4 em:hover, h5 em:hover, h6 em:hover,
.hero-jp-word:hover, .hero h1 .jp-word:hover,
.section-title em:hover, .subtitle em:hover {
  color: var(--violet-500) !important;
  cursor: default;
}

p, .body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--fg);
  margin: 0 0 var(--space-4) 0;
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--fg);
}

small, .caption {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--fg-muted);
}

.micro {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--fg-subtle);
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--paper-100);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
  color: var(--violet-700);
}

a {
  color: var(--violet-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
  transition: text-decoration-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
a:hover {
  color: var(--violet-700);
  text-decoration-color: currentColor;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

::selection {
  background: var(--violet-200);
  color: var(--violet-900);
}

/* Visually hidden, still read by screen readers and search engines */
.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; }

/* Skip link: first focusable element on every page */
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 1000; background: var(--paper-900); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 16px; }

/* ===== Site footer (shared, src/_includes/footer.njk) ===== */
.site-footer { background: var(--paper-900); color: var(--paper-100); padding: 56px 60px 28px; margin-top: 0; }
.site-footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; max-width: 1200px; margin: 0 auto; }
.site-footer .footer-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0; }
.site-footer .footer-logo img { width: 44px; height: 44px; object-fit: contain; }
.site-footer .footer-logo .wm { font-weight: 800; font-size: 15px; color: var(--paper-0); line-height: 1.1; }
.site-footer .footer-brand p { font-size: 13px; color: var(--paper-400); line-height: 1.6; margin: 14px 0 0; max-width: 260px; }
.site-footer .fh { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--orange-300); margin: 0 0 12px; }
.site-footer a, .site-footer .footer-link-btn { color: var(--paper-300); display: block; text-decoration: none; font-size: 13px; padding: 4px 0; transition: color .18s; }
.site-footer a:hover, .site-footer .footer-link-btn:hover { color: var(--orange-300); }
.site-footer .footer-link-btn { background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; }
.site-footer address { font-style: normal; font-size: 13px; line-height: 1.7; color: var(--paper-300); }
.site-footer address a { display: inline; padding: 0; }
.site-footer .footer-bottom { max-width: 1200px; margin: 36px auto 0; padding-top: 18px; border-top: 1px solid var(--paper-800); display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--paper-400); }
.site-footer .footer-bottom p { margin: 0; }
@media (max-width: 960px) { .site-footer .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .site-footer { padding: 40px 20px 24px; }
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .site-footer .footer-bottom { flex-direction: column; }
}

/* ===== Cookie consent (src/consent.js) ===== */
.consent-banner { position: fixed; z-index: 900; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-left: auto;
  background: var(--paper-0); color: var(--fg); border: 1px solid var(--paper-200); border-radius: 20px;
  box-shadow: 0 18px 50px -12px rgba(20,18,16,.28); padding: 18px 20px; font-size: 13px; line-height: 1.5; }
.consent-banner[hidden] { display: none; }
.consent-banner p { margin: 0 0 12px; }
.consent-banner strong { display: block; font-size: 14px; margin-bottom: 2px; }
.consent-banner a { color: var(--orange-700); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-btn { flex: 1 1 auto; min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 2px solid var(--orange-500);
  background: var(--orange-500); color: #fff; font: 700 13px/1 var(--font-sans); cursor: pointer; }
.consent-btn.ghost { background: transparent; color: var(--orange-700); }
.consent-btn:hover { background: var(--orange-600); border-color: var(--orange-600); color: #fff; }
.consent-btn:focus-visible { outline: 3px solid var(--orange-300); outline-offset: 2px; }
.consent-dialog { max-width: 520px; width: calc(100% - 32px); border: 0; border-radius: 22px; padding: 24px; color: var(--fg); }
.consent-dialog::backdrop { background: rgba(20,18,16,.45); }
.consent-dialog h2 { font-size: 20px; margin: 0 0 6px; }
.consent-dialog > form > p { font-size: 14px; color: var(--fg-muted); margin: 0 0 14px; }
.consent-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--paper-200); font-size: 13px; line-height: 1.5; cursor: pointer; }
.consent-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--orange-500); }
.consent-row strong { display: block; font-size: 14px; }
.consent-dialog .consent-actions { margin-top: 16px; }

/* Respect the system "reduce motion" setting everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Interaction basics */
html { scroll-padding-top: 96px; color-scheme: light; }
a, button, summary, label, input, select, textarea { touch-action: manipulation; }
a, button, summary { -webkit-tap-highlight-color: rgba(188, 80, 27, .15); }
.consent-dialog, .mobile-drawer { overscroll-behavior: contain; }
