/* ──────────────────────────────────────────────────────────────────────
   Emtasys — Luxury Editorial Design System
   Single source of truth. Pages consume via <link rel="stylesheet"
   href="/css/editorial.css"> plus /js/tailwind-config.js.
   ────────────────────────────────────────────────────────────────────── */

/* ── Design tokens as CSS variables (for non-Tailwind styling) ───────── */
:root {
    --paper:       #F5F4F0;
    --paper-2:     #EDEBE5;
    --cream:       #F0EADD;
    --ink:         #111013;
    --ink-soft:    #3B3A40;
    --ink-mute:    #6B6A70;
    --indigo:      #3F2BD4;
    --indigo-dark: #2E1FA6;
    --indigo-pale: #E9E4FB;
    --hairline:    #D8D5CD;
    /* Back-compat */
    --primary:       #3F2BD4;
    --primary-dark:  #2E1FA6;
    --accent:        #3F2BD4;
}

/* ── Base ─────────────────────────────────────────────────────────── */
html, body {
    background: #F5F4F0;
    color: #111013;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Display — Instrument Serif, HEADLINES ONLY (not card/tenet titles) */
.display {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.015em;
    line-height: 1.0;
}
.display-italic {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    color: #3F2BD4;
    letter-spacing: -0.01em;
}

/* ── Sans headlines for card/tenet/process titles (readable at 20-28px) */
.title-sans {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

/* ── Labels ───────────────────────────────────────────────────────── */
.smallcaps {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    font-weight: 500;
}
.eyebrow {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 10px;
    color: #6B6A70;
}
.section-marker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 10px;
    color: #3F2BD4;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Body (Inter, always) ─────────────────────────────────────────── */
.body-lg { font-size: 17px; line-height: 1.6; color: #3B3A40; }
.body    { font-size: 15px; line-height: 1.6; color: #3B3A40; }
.body-sm { font-size: 13px; line-height: 1.55; color: #3B3A40; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-ink {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; background: #3F2BD4; color: #fff;
    border-radius: 999px; padding: 13px 26px;
    font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
    border: 1px solid #3F2BD4; cursor: pointer;
    transition: background .2s, border-color .2s;
    text-decoration: none;
}
.btn-ink:hover { background: #2E1FA6; border-color: #2E1FA6; color: #fff; }
.btn-ink:focus-visible { outline: 2px solid #111013; outline-offset: 3px; }

.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; background: transparent; color: #111013;
    border: 1px solid #111013; border-radius: 999px;
    padding: 12px 25px; font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
    cursor: pointer; transition: background .2s, color .2s;
    text-decoration: none;
}
.btn-ghost:hover { background: #111013; color: #F5F4F0; }
.btn-ghost:focus-visible { outline: 2px solid #3F2BD4; outline-offset: 3px; }

.btn-ink-sm {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; background: #3F2BD4; color: #fff;
    border-radius: 999px; padding: 8px 18px;
    font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
    border: 1px solid #3F2BD4; cursor: pointer;
    transition: background .2s, border-color .2s;
    text-decoration: none;
}
.btn-ink-sm:hover { background: #2E1FA6; border-color: #2E1FA6; color: #fff; }

.btn-ghost-sm {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; background: transparent; color: #111013;
    border: 1px solid #111013; border-radius: 999px;
    padding: 7px 17px; font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
    cursor: pointer; transition: background .2s, color .2s;
    text-decoration: none;
}
.btn-ghost-sm:hover { background: #111013; color: #F5F4F0; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card-editorial,
.mirror-card {
    background: #ffffff;
    border: 1px solid #D8D5CD;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card-editorial:hover,
.mirror-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -24px rgba(17,16,19,0.22);
    border-color: #111013;
}
.mirror-glass {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(17,16,19,0.08);
}
.card-flat {
    background: #ffffff;
    border: 1px solid #D8D5CD;
}

/* ── Form controls ────────────────────────────────────────────────── */
.input-editorial {
    width: 100%;
    background: #ffffff;
    color: #111013;
    border: 1px solid #D8D5CD;
    border-radius: 0;
    padding: 12px 14px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px; line-height: 1.5;
    transition: border-color .2s, box-shadow .2s;
}
.input-editorial:focus {
    outline: none;
    border-color: #111013;
    box-shadow: inset 0 -1px 0 0 #111013;
}
.input-editorial::placeholder { color: #9A9AA0; }

.input-editorial-error { border-color: #B4232E; }

label.field-label {
    display: block;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #6B6A70;
    margin-bottom: 8px;
}

/* ── Rules ────────────────────────────────────────────────────────── */
.rule-h      { border-top: 1px solid #D8D5CD; }
.rule-h-ink  { border-top: 1px solid #111013; }
.rule-v      { border-left: 1px solid #D8D5CD; }
.rule-v-ink  { border-left: 1px solid #111013; }

/* ── Arrow link ───────────────────────────────────────────────────── */
.arrow-link {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase; letter-spacing: 0.14em;
    font-size: 11px; font-weight: 500; color: #111013;
    text-decoration: none;
}
.arrow-link::after {
    content: ''; display: inline-block;
    width: 20px; height: 1px; background: currentColor;
    transition: width .25s ease;
}
.arrow-link:hover::after { width: 36px; }

/* ── Scroll reveal ────────────────────────────────────────────────── */
.stagger { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; }
.stagger.is-visible { opacity: 1; transform: translateY(0); }

/* ── Focus ring (global fallback) ─────────────────────────────────── */
a:focus-visible, button:focus-visible {
    outline: 2px solid #3F2BD4;
    outline-offset: 3px;
    border-radius: 2px;
}

/* ── Skip link ────────────────────────────────────────────────────── */
.skip-link {
    position: absolute; top: -40px; left: 8px;
    background: #111013; color: #F5F4F0;
    padding: 10px 16px; z-index: 100;
    text-decoration: none;
    font-size: 12px; letter-spacing: 0.1em;
    transition: top .14s ease-out;
}
.skip-link:focus { top: 8px; }

/* ── Type scale ───────────────────────────────────────────────────── */
.headline-xxl { font-size: clamp(44px, 6vw, 84px);  line-height: 1.02; }
.headline-xl  { font-size: clamp(34px, 4.4vw, 64px); line-height: 1.06; }
.headline-l   { font-size: clamp(28px, 3.6vw, 48px); line-height: 1.1;  }
.headline-m   { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.2;  }

/* ── Tags / chips ─────────────────────────────────────────────────── */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border: 1px solid #D8D5CD;
    background: #ffffff; color: #3B3A40;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
    border-radius: 999px;
}
.chip-ink {
    background: #111013; color: #F5F4F0; border-color: #111013;
}
.chip-indigo {
    background: #E9E4FB; color: #2E1FA6; border-color: #E9E4FB;
}

/* ── Category badge on cards ──────────────────────────────────────── */
.cat-badge {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    text-transform: uppercase; letter-spacing: 0.2em;
    font-size: 10px; color: #6B6A70;
}

/* ── Legal / prose ────────────────────────────────────────────────── */
.legal-prose h2 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 28px; line-height: 1.2; color: #111013;
    margin-top: 40px; margin-bottom: 14px; font-weight: 400;
    letter-spacing: -0.01em;
}
.legal-prose h3 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px; font-weight: 600; color: #111013;
    margin-top: 28px; margin-bottom: 10px;
    letter-spacing: -0.01em;
}
.legal-prose p,
.legal-prose li {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px; line-height: 1.7; color: #3B3A40;
    margin-bottom: 12px;
}
.legal-prose ul { padding-left: 20px; margin-bottom: 16px; list-style: disc; }
.legal-prose a  { color: #3F2BD4; text-decoration: underline; text-underline-offset: 2px; }
.legal-prose a:hover { color: #2E1FA6; }
.legal-prose strong { color: #111013; font-weight: 600; }
.legal-prose hr { border: 0; border-top: 1px solid #D8D5CD; margin: 40px 0; }

/* ── Data table (used in cookies.html + admin) ────────────────────── */
.table-editorial {
    width: 100%; border-collapse: collapse;
    font-family: 'Inter', system-ui, sans-serif; font-size: 13px;
}
.table-editorial thead th {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    text-transform: uppercase; letter-spacing: 0.16em;
    font-size: 10px; font-weight: 500; color: #6B6A70;
    text-align: left; padding: 10px 12px;
    border-bottom: 1px solid #111013; background: #EDEBE5;
}
.table-editorial tbody td {
    padding: 14px 12px; border-bottom: 1px solid #D8D5CD; color: #3B3A40;
}
.table-editorial tbody tr:hover td { background: #F5F4F0; }

/* ── Status strip (top of every page) ─────────────────────────────── */
.status-strip {
    background: #F5F4F0;
    border-bottom: 1px solid #D8D5CD;
}
.status-strip-inner {
    max-width: 1240px; margin: 0 auto;
    padding: 8px 24px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em;
    display: flex; align-items: center; justify-content: space-between;
}

/* ── Masthead (nav) ───────────────────────────────────────────────── */
.masthead          { background: #F5F4F0; position: relative; }
.masthead-inner    { max-width: 1240px; margin: 0 auto; padding: 16px 24px; }
.masthead-link     {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px; color: #111013;
    position: relative; padding: 4px 0;
    transition: color .2s;
    text-decoration: none;
}
.masthead-link:hover { color: #3F2BD4; }
.masthead-link.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
    height: 1px; background: #3F2BD4;
}

/* ── Hero showcase (square frame) ─────────────────────────────────── */
.showcase-frame {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #EDEBE5;
    border: 1px solid #111013;
}
.showcase-slide {
    position: absolute; inset: 0; opacity: 0;
    transition: opacity .7s ease; pointer-events: none;
}
.showcase-slide.active { opacity: 1; pointer-events: auto; }
.showcase-slide > .cover {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
}
.showcase-slide > .tint {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(17,16,19,0) 55%, rgba(17,16,19,0.75) 100%);
}
.showcase-slide > .meta {
    position: absolute; left: 22px; right: 22px; bottom: 20px; color: #fff;
}
.showcase-indicators { display: inline-flex; gap: 6px; }
.showcase-dot {
    width: 28px; height: 22px;
    display: inline-flex; align-items: center;
    cursor: pointer; border: 0; background: transparent; padding: 0;
}
.showcase-dot::before {
    content: ''; display: block;
    width: 100%; height: 2px;
    background: #D8D5CD;
    transition: background .25s;
}
.showcase-dot.active::before { background: #3F2BD4; }
.showcase-fallback {
    position: absolute; inset: 0;
    background: #F0EADD;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Instrument Serif', serif;
    font-style: italic; font-weight: 400;
    font-size: 160px; color: #111013; opacity: 0.55;
}

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .showcase-slide, .stagger {
        animation: none !important;
        transition: none !important;
    }
    .stagger { opacity: 1; transform: none; }
    .showcase-slide { opacity: 1; }
    .showcase-slide:not(.active) { display: none; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Back-compat: contrast bump for legacy slate-400 text ─────────── */
.text-slate-400:not(.material-icons):not(.material-icons-outlined):not(.material-symbols-outlined),
.text-gray-400:not(.material-icons):not(.material-icons-outlined):not(.material-symbols-outlined) {
    color: #6B6A70;
}

/* ── Avatar dropdown (used by /js/account-menu.js) ────────────────── */
.avatar-btn {
    width: 36px; height: 36px; border-radius: 999px;
    background: #111013; color: #F5F4F0;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 18px; font-style: italic;
    border: 1px solid #111013;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.avatar-btn:hover { background: #3F2BD4; border-color: #3F2BD4; }
.avatar-menu {
    position: absolute; right: 0; top: calc(100% + 10px);
    min-width: 200px;
    background: #ffffff; border: 1px solid #111013;
    box-shadow: 0 20px 40px -24px rgba(17,16,19,0.22);
    z-index: 50;
}
.avatar-menu a,
.avatar-menu button {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px; color: #111013;
    text-decoration: none; background: transparent; border: 0;
    width: 100%; text-align: left; cursor: pointer;
    transition: background .15s, color .15s;
}
.avatar-menu a:hover,
.avatar-menu button:hover { background: #F5F4F0; color: #3F2BD4; }
.avatar-menu .divider {
    border-top: 1px solid #D8D5CD; margin: 0;
}

/* ── Sidebar (dashboard, admin) ───────────────────────────────────── */
.sidebar {
    background: #111013; color: #F5F4F0;
    border-right: 1px solid #111013;
}
.sidebar a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px; color: rgba(245,244,240,0.7);
    text-decoration: none;
    transition: color .15s, background .15s;
}
.sidebar a:hover { color: #ffffff; background: rgba(255,255,255,0.05); }
.sidebar a.active {
    color: #ffffff; background: rgba(255,255,255,0.06);
    border-left: 2px solid #3F2BD4; padding-left: 14px;
}
