/* ==========================================================================
   Sartor CV — landing page
   Warm "brown paper" theme (Requirements 2.2).
   All text/background pairs below were checked against WCAG AA (>= 4.5:1).
   ========================================================================== */

:root {
    /* paper */
    --paper:        #F1E3CB;   /* page ground */
    --paper-deep:   #E6D2B0;   /* recessed areas, borders */
    --paper-light:  #FAF3E3;   /* raised surfaces */
    --card:         #FBF5E8;
    --kraft:        #B98B5E;   /* decorative only, never text */
    --rule:         rgba(91, 69, 52, 0.22);

    /* ink */
    --ink:          #2B1F16;   /* 12.7:1 on paper */
    --ink-soft:     #5B4534;   /*  7.1:1 on paper */
    --ink-mute:     #6E5844;   /*  5.3:1 on paper */

    /* accents */
    --brown:        #5C3A21;   /* primary buttons, 9.5:1 with --on-brown */
    --brown-hover:  #46291A;
    --on-brown:     #FFF7E8;
    --terra:        #9C4321;   /*  5.1:1 on paper */
    --sage:         #3F6B4B;
    --focus:        #9C4321;

    /* announcement bar */
    --bar-bg:       #3A281B;
    --bar-text:     #F6E9D2;

    /* type */
    --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* shape */
    --radius:       14px;
    --radius-lg:    22px;
    --shadow-sm:    0 1px 2px rgba(64, 40, 20, .14), 0 2px 6px rgba(64, 40, 20, .08);
    --shadow-md:    0 10px 24px -8px rgba(64, 40, 20, .28), 0 2px 6px rgba(64, 40, 20, .10);

    /* paper grain (tiny inline SVG noise, no extra request) */
    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .36  0 0 0 0 .23  0 0 0 0 .11  0 0 0 .17 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    --fibres: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.012 .4' numOctaves='2' seed='5' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .30  0 0 0 0 .15  0 0 0 .10 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(120% 70% at 50% -10%, rgba(255, 248, 232, .75), transparent 60%),
        var(--grain),
        var(--fibres);
    background-attachment: fixed, scroll, scroll;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: var(--terra); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--brown-hover); }

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

.container {
    width: 100%;
    max-width: 1160px;
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 32px);
}

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--brown); color: var(--on-brown);
    padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

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

/* ---------- 2.1 announcement bar (rolling ticker) ---------- */
.announce {
    position: relative;
    background: var(--bar-bg);
    color: var(--bar-text);
    overflow: hidden;
    max-height: 120px;
    transition: max-height .3s ease, opacity .25s ease;
}
.announce[hidden] { display: none; }
.announce.is-closing { max-height: 0; opacity: 0; }

/* static message: the default, what reduced-motion users see, and what screen readers always read */
.announce-static {
    margin: 0; padding: 6px 48px; min-height: 34px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-size: .8125rem; font-weight: 600; line-height: 1.3; letter-spacing: .01em;
}
.announce.is-rolling .announce-static {
    position: absolute; width: 1px; height: 1px; padding: 0; min-height: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.announce-marquee {
    display: none; overflow: hidden; padding-block: 8px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 60px), transparent calc(100% - 44px));
            mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 60px), transparent calc(100% - 44px));
}
.announce.is-rolling .announce-marquee { display: block; }

.announce-track {
    display: flex; width: max-content;
    animation: roll var(--roll-duration, 24s) linear infinite;
    will-change: transform;
}
.announce-group { display: flex; flex: none; }
.announce-item {
    display: inline-flex; align-items: center; flex: none; white-space: nowrap;
    font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
}
.announce-item::after {              /* dot between repeats */
    content: ""; width: 5px; height: 5px; margin-inline: 22px; border-radius: 50%; background: #F2C66B; flex: none;
}
@keyframes roll { to { transform: translateX(-50%); } }

/* WCAG 2.2.2: the user can stop the motion by hovering or focusing the bar */
.announce:hover .announce-track, .announce:focus-within .announce-track { animation-play-state: paused; }

.announce-close {
    position: absolute; right: 0; top: 0; bottom: 0; z-index: 1;
    width: 44px; padding-right: max(0px, env(safe-area-inset-right, 0px));
    display: grid; place-items: center;
    color: var(--bar-text); background: var(--bar-bg); border: 0; border-radius: 0;
    cursor: pointer;
}
.announce-close:hover { background: #4A3626; }
.announce-close:focus-visible { outline-color: #F2C66B; outline-offset: -4px; }

/* ---------- header ---------- */
.site-header { padding-block: 18px 6px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.65rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 14px 28px;
    font: inherit; font-weight: 600; font-size: 1.0625rem; letter-spacing: .005em;
    text-decoration: none; cursor: pointer;
    border-radius: 999px; border: 1.5px solid transparent;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.btn svg { transition: transform .18s ease; flex: none; }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
    background: var(--brown); color: var(--on-brown);
    box-shadow: 0 3px 0 #33200f, 0 12px 22px -10px rgba(51, 32, 15, .7);
}
.btn-primary:hover { background: var(--brown-hover); color: var(--on-brown); transform: translateY(-1px); box-shadow: 0 4px 0 #2a190b, 0 16px 26px -12px rgba(51, 32, 15, .75); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #33200f; }

.btn-ghost { background: transparent; color: var(--brown); border-color: rgba(92, 58, 33, .45); }
.btn-ghost:hover { background: rgba(92, 58, 33, .08); color: var(--brown); border-color: var(--brown); }

.btn-light { background: var(--paper-light); color: var(--brown); box-shadow: 0 3px 0 #b9975f, 0 12px 22px -10px rgba(0, 0, 0, .5); }
.btn-light:hover { background: #fff; color: var(--brown-hover); transform: translateY(-1px); }

/* ---------- 2.4 hero ---------- */
.hero { padding-block: clamp(28px, 5vw, 64px) clamp(48px, 7vw, 96px); }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);   /* copy left, image right */
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
}
.eyebrow {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-body); font-size: .8125rem; font-weight: 600; font-style: normal;
    letter-spacing: .12em; text-transform: uppercase; line-height: 1.4;
    color: var(--terra); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }

.hero h1 { font-size: clamp(2.9rem, 7vw, 5rem); font-weight: 700; line-height: .98; }
.hero h1 em {
    font-style: italic; color: var(--terra); white-space: nowrap;
    background: linear-gradient(transparent 82%, rgba(232, 184, 74, .55) 82% 94%, transparent 94%);
    padding-inline: .04em;
}
.hero-sub { margin-top: 22px; max-width: 34em; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.chips li {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px 7px 10px; border-radius: 999px;
    background: rgba(250, 243, 227, .8); border: 1px solid var(--rule);
    font-size: .875rem; font-weight: 500; color: var(--ink-soft);
}
.chips svg { color: var(--sage); flex: none; }

.hero-art { justify-self: center; width: 100%; max-width: 540px; }
.hero-art img { width: 100%; filter: drop-shadow(0 18px 24px rgba(64, 40, 20, .12)); }

/* ---------- section scaffolding ---------- */
.section { padding-block: clamp(48px, 7vw, 96px); }
.section-head { margin-bottom: clamp(24px, 4vw, 44px); }
.section-head p { max-width: 46rem; }
.section-head h2, .features-intro h2 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); font-weight: 700; }
.section-head p, .features-intro p { margin-top: 14px; color: var(--ink-soft); font-size: 1.125rem; }

/* ---------- 2.6 templates carousel ---------- */
.templates .section-head h2 { white-space: nowrap; font-size: clamp(1.5rem, 6.4vw, 3.2rem); }   /* title always on one row */
.templates { background: linear-gradient(180deg, rgba(230, 210, 176, .55), rgba(230, 210, 176, .25)); border-block: 1px solid var(--rule); }

.carousel { position: relative; }
.track {
    display: flex; gap: clamp(16px, 2.4vw, 28px);
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 14px clamp(16px, 4vw, 32px) 30px;
    margin-inline: calc(clamp(16px, 4vw, 32px) * -1);
    scroll-padding-inline: clamp(16px, 4vw, 32px);
}
.track::-webkit-scrollbar { display: none; }
.track { cursor: grab; }
.track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.track img { -webkit-user-drag: none; user-select: none; }
.track:focus-visible { outline-offset: -2px; }

.slide {
    flex: 0 0 clamp(236px, 27vw, 300px);
    scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.slide-thumb {
    width: 100%; aspect-ratio: 320 / 440;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.slide:hover .slide-thumb { transform: translateY(-6px) rotate(-.6deg); }
.slide h3 { margin-top: 12px; font-size: 1.55rem; font-weight: 700; }
.slide p { margin-top: 6px; min-height: 4.5em; max-width: 24ch; color: var(--ink-soft); font-size: .9375rem; line-height: 1.5; text-wrap: balance; }

/* elegant "try" button: outlined pill, fills like a wax stamp on hover */
.btn-try {
    margin-top: 16px; min-height: 46px; padding: 10px 22px;
    font-size: .9375rem;
    color: var(--brown); background: var(--paper-light);
    border: 1.5px solid var(--brown); box-shadow: 0 2px 0 rgba(92, 58, 33, .35);
}
.btn-try:hover { background: var(--brown); color: var(--on-brown); transform: translateY(-1px); }

.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.dots { display: flex; gap: 2px; }
.dot { width: 28px; height: 44px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; padding: 0; }
.dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: rgba(92, 58, 33, .28); border: 1.5px solid transparent; transition: transform .2s, background-color .2s; }
.dot[aria-current="true"]::before { background: var(--brown); transform: scale(1.3); }

/* ---------- 2.7 features ---------- */
.features-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 80px); align-items: start; }

/* left column: descriptive copy (also useful for search engines) */
.features-intro h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.features-intro .lede { margin-top: 16px; font-size: 1.0625rem; }
.mini-title { margin-top: 30px; font-size: 1.6rem; font-weight: 700; }
.steps { list-style: none; counter-reset: step; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; color: var(--ink-soft); font-size: 1rem; }
.steps li::before {
    content: counter(step); width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: 50%; background: var(--brown); color: var(--on-brown);
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
}
.steps strong { color: var(--ink); font-weight: 600; }

.ats-box {
    margin-top: 32px; padding: 24px 26px;
    background: #FFF2D2; border: 1px solid #E5C77E; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.ats-box h3 { font-size: 1.55rem; font-weight: 700; color: #2E1F0C; }
.ats-box p { margin-top: 12px; font-size: 1rem; line-height: 1.6; color: #3E2C14; }
.ats-box strong { color: #2E1F0C; }

/* right column: the perks "notepad" */
.notepad {
    --np-pad: clamp(18px, 3vw, 34px);   /* card side padding */
    --icon: 48px;                        /* icon tile */
    --gap: 20px;                         /* space between icon and text */
    list-style: none; margin: 0; padding: clamp(6px, 1.5vw, 14px) var(--np-pad);
    background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: sticky; top: 28px; overflow: hidden;
}
.notepad::before { /* margin line of a legal pad, centred in the gutter between icon and text */
    content: ""; position: absolute; inset-block: 0;
    left: calc(var(--np-pad) + var(--icon) + var(--gap) / 2 - .75px); width: 1.5px;
    background: rgba(156, 67, 33, .28); pointer-events: none;
}
.feature { display: grid; grid-template-columns: var(--icon) minmax(0, 1fr); column-gap: var(--gap); align-items: center; padding: 24px 0; }
.feature + .feature { border-top: 1.5px dashed var(--rule); }
.feature-icon {
    width: var(--icon); height: var(--icon); display: grid; place-items: center;
    color: var(--brown); background: var(--paper-deep); border-radius: 14px;
}
.feature h3 { font-size: 1.4rem; font-weight: 700; line-height: 1.15; }
.feature p { margin-top: 6px; color: var(--ink-soft); font-size: 1rem; }

.lang-links { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }   /* sits under the text column */
.lang-links a {
    display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px;
    border-radius: 999px; border: 1.5px solid rgba(92, 58, 33, .4);
    background: var(--paper-light); color: var(--brown); font-weight: 600; font-size: .9375rem; text-decoration: none;
    transition: background-color .18s, color .18s;
}
.lang-links a:hover { background: var(--brown); color: var(--on-brown); }
.lang-links a[aria-current="true"] { background: var(--brown); color: var(--on-brown); border-color: var(--brown); }

.info-btn {
    display: inline-grid; place-items: center; vertical-align: middle;
    width: 44px; height: 44px; margin: -10px 0 -10px 2px;
    background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--terra);
}
.nowrap { white-space: nowrap; }
.info-btn span {
    width: 24px; height: 24px; display: grid; place-items: center;
    border: 1.8px solid currentColor; border-radius: 50%;
    font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 1.05rem; line-height: 1;
    transition: background-color .18s, color .18s;
}
.info-btn:hover span, .info-btn:focus-visible span { background: var(--terra); color: var(--on-brown); }

/* ---------- hover popup (positioned by landing.js) ---------- */
.popup {
    position: fixed; z-index: 50; top: 0; left: 0;
    width: min(320px, calc(100vw - 24px));
    padding: 14px 16px 15px;
    background: #FFF2D2; color: #3E2C14;
    border: 1px solid #E5C77E; border-radius: 14px;
    box-shadow: 0 18px 40px -14px rgba(43, 31, 22, .5), 0 2px 6px rgba(43, 31, 22, .12);
    font-size: .9375rem; line-height: 1.5; text-align: left;
}
.popup[hidden] { display: none; }
.popup strong { display: block; font-family: var(--font-display); font-size: 1.2rem; line-height: 1.2; color: #2E1F0C; }
.popup p { margin-top: 6px; }
.popup::before {                     /* invisible bridge so the pointer can travel from the button into the popup */
    content: ""; position: absolute; left: 0; right: 0; height: 14px; top: -14px;
}
.popup::after {                      /* caret pointing at the button */
    content: ""; position: absolute; left: var(--arrow-x, 50%); top: -6px; width: 10px; height: 10px; margin-left: -5px;
    background: #FFF2D2; border-left: 1px solid #E5C77E; border-top: 1px solid #E5C77E; transform: rotate(45deg);
}
.popup.is-above::before { top: auto; bottom: -14px; }
.popup.is-above::after { top: auto; bottom: -6px; transform: rotate(225deg); }

/* ---------- 2.3(4) closing CTA + footer ---------- */
.cta { padding-block: 0 clamp(48px, 7vw, 88px); }
.cta-card {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px 40px;
    padding: clamp(28px, 5vw, 56px);
    background: var(--bar-bg); color: var(--bar-text);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.cta-card::before { /* soft paper grain over the dark card */
    content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: .5; mix-blend-mode: soft-light; z-index: -1;
}
.cta-card::after { /* crane watermark */
    content: ""; position: absolute; right: -30px; bottom: -40px; width: 260px; height: 212px; z-index: -1; opacity: .09;
    background: url("resources/logo.svg") no-repeat center / contain; filter: grayscale(1) invert(1);
}
.cta-card h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 700; color: #FFF3DC; }
.cta-card p { margin-top: 10px; font-size: 1.125rem; color: #E9D7B8; }

.site-footer {
    border-top: 1px solid var(--rule); background: rgba(230, 210, 176, .35);
    padding: 26px 16px calc(26px + env(safe-area-inset-bottom, 0px)); text-align: center;
}
.footer-line { font-size: .9375rem; color: var(--ink-soft); }
.footer-line a { font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }              /* copy above image */
    .hero-art { max-width: 440px; }
    .features-grid { grid-template-columns: 1fr; }
    .notepad { position: relative; top: auto; }
    .cta-card { grid-template-columns: 1fr; }
    .cta-card .btn { justify-self: start; }
}
@media (max-width: 520px) {
    body { font-size: 1rem; }
    .brand-name { font-size: 1.4rem; }
    .brand img { width: 38px; }
    .hero-actions .btn { flex: 1 1 100%; }
    .notepad { --icon: 44px; --gap: 14px; }
    .ats-box { padding: 20px; }
    .announce-static { padding-inline: 44px; font-size: .75rem; }
}

/* ---------- entrance + motion (opt-in only) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .popup:not([hidden]) { animation: pop .16s ease-out; }
    @keyframes pop { from { opacity: 0; transform: translateY(4px); } }
    .hero-art img { animation: bob 7s ease-in-out infinite; }
    @keyframes bob { 50% { transform: translateY(-8px) rotate(.4deg); } }

    .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
    .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    html, .track { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* high-contrast / forced colours */
@media (forced-colors: active) {
    .btn, .lang-links a, .chips li { border: 1.5px solid ButtonText; }
    .dot[aria-current="true"]::before { background: Highlight; }
}
