/* theme.css — site-wide polish layer.
 * Loaded by every page. Adds the slick+modern refinements without
 * rewriting any page's existing styles. Selectors are conservative
 * so nothing in a page CSS is overridden — we only ADD where there
 * was no rule, or NUDGE where the page rule didn't include shadows
 * / transitions.
 *
 * Loaded as: <link rel="stylesheet" href="/theme.css">
 */

/* ───── Typography ───── *
 * Plus Jakarta Sans     = warm geometric sans for body text.
 * Fraunces              = expressive variable serif for display headlines.
 * Atkinson Hyperlegible = dyslexia-friendly stack used by the body.pfh-dys
 *                         accessibility toggle on /me.
 * All load with display=swap so first paint never blocks. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Fraunces:opsz,wght,SOFT@9..144,500..900,30..100&family=Atkinson+Hyperlegible:wght@400;700&display=swap');

:root {
  --pfh-shadow-1: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.05);
  --pfh-shadow-2: 0 4px 14px rgba(15,23,42,.07), 0 2px 6px rgba(15,23,42,.06);
  --pfh-shadow-3: 0 12px 32px rgba(15,23,42,.10), 0 4px 12px rgba(15,23,42,.08);
  --pfh-radius: 12px;
  --pfh-ease: cubic-bezier(.22, 1, .36, 1);
  --pfh-font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --pfh-font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --pfh-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pfh-brand: #1f3d2b;
  --pfh-brand-2: #2d6a4f;
  --pfh-brand-3: #40916c;
}

/* Smoother body text rendering — and apply the new type pair site-wide.
 * font-family on html,body wins over every page's previous fallback list,
 * so this rolls out everywhere theme.css is loaded. */
html, body {
  font-family: var(--pfh-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";  /* Plus Jakarta Sans alts */
}

/* Display headings use the variable serif. opsz auto-scales the optical
 * size to the actual font-size; SOFT 50 makes corners gently rounded. */
h1, h2, h3 {
  font-family: var(--pfh-font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "wght" 700;
  letter-spacing: -.025em;
  font-weight: 700;
}
h4, h5, h6 {
  font-family: var(--pfh-font-body);
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ───── Site header (unified, injected by polish-html middleware) ───── */
.site-header[data-pfh-unified]{
  position:sticky; top:0; z-index:50;
  background:rgba(250,251,252,.92);
  backdrop-filter:saturate(160%) blur(14px);
  border-bottom:1px solid #e6e8ec;
}
.site-header[data-pfh-unified] .nav-wrap{
  max-width:1240px; margin:0 auto; padding:14px 28px;
  display:flex; align-items:center; gap:28px;
}
.site-header[data-pfh-unified] .brand{
  display:flex; align-items:center; gap:10px;
  font-size:16px; font-weight:800; color:#0a0a0c;
  text-decoration:none; flex-shrink:0;
}
.site-header[data-pfh-unified] .brand:hover{ text-decoration:none; }
.site-header[data-pfh-unified] .word{
  display:flex; flex-direction:column; line-height:1.05;
}
.site-header[data-pfh-unified] .word b{
  font-size:15px; letter-spacing:-.005em; font-weight:800;
  font-family:var(--pfh-font-body);
}
.site-header[data-pfh-unified] .word small{
  font-size:10px; letter-spacing:.12em; text-transform:uppercase;
  font-weight:600; color:var(--pfh-brand-2);
  font-family:var(--pfh-font-body);
}
.site-header[data-pfh-unified] .nav-links{
  display:flex; gap:22px; flex:1; font-size:14px; align-items:center;
}
.site-header[data-pfh-unified] .nav-links a{
  color:#5a5d63; font-weight:500; padding:6px 0;
  border-bottom:2px solid transparent;
  transition: all .15s ease;
  text-decoration:none;
}
.site-header[data-pfh-unified] .nav-links a:hover{
  color:#0a0a0c; border-bottom-color:var(--pfh-brand-3);
}
.site-header[data-pfh-unified] .nav-cta{
  display:flex; align-items:center; gap:10px;
}
.site-header[data-pfh-unified] .nav-cta .me-link{
  font-size:14px; font-weight:500; color:#5a5d63;
  padding:8px 14px; text-decoration:none;
}
.site-header[data-pfh-unified] .nav-cta .me-link:hover{
  color:#0a0a0c;
}
.site-header[data-pfh-unified] .btn-primary{
  background:var(--pfh-brand-2); color:#fff;
  padding:11px 22px; border-radius:10px;
  font-size:14px; font-weight:600;
  text-decoration:none;
  box-shadow:0 1px 3px rgba(45,106,79,.3);
  transition: all .15s ease;
}
.site-header[data-pfh-unified] .btn-primary:hover{
  background:var(--pfh-brand);
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(45,106,79,.35);
}
@media (max-width:780px){
  .site-header[data-pfh-unified] .nav-links{ display:none; }
  .site-header[data-pfh-unified] .nav-wrap{ padding:12px 16px; }
  .site-header[data-pfh-unified] .word small{ display:none; }
}

/* ───── Brand logo (SVG mark with draw-in animation) ───── */
.brand-logo{
  width:36px; height:36px; flex-shrink:0;
  border-radius:9px;
  background: linear-gradient(135deg, var(--pfh-brand) 0%, var(--pfh-brand-2) 50%, var(--pfh-brand-3) 100%);
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow: 0 2px 10px rgba(45,106,79,.35), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .25s var(--pfh-ease), box-shadow .25s var(--pfh-ease);
  position:relative;
}
.brand-logo svg{ width:22px; height:22px; display:block; }
.brand-logo svg path{
  stroke:#fff; stroke-width:3; stroke-linecap:round; stroke-linejoin:round;
  fill:none;
  stroke-dasharray: 40;
  stroke-dashoffset: 0;
  animation: brandDraw 1.6s var(--pfh-ease) both;
}
@keyframes brandDraw {
  0%   { stroke-dashoffset: 40; opacity: 0; }
  20%  { opacity: 1; }
  100% { stroke-dashoffset: 0;  opacity: 1; }
}
a:hover > .brand-logo,
.brand:hover .brand-logo {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: 0 4px 16px rgba(45,106,79,.5), inset 0 1px 0 rgba(255,255,255,.18);
}
a:hover > .brand-logo svg path,
.brand:hover .brand-logo svg path {
  animation: brandDraw 0.7s var(--pfh-ease) both;
}

/* Eye-catcher: a slow shimmer that sweeps across an element once,
 * triggered by adding class="pfh-shimmer-once". Used on the homepage
 * eyebrow and on freshly-saved confirmation pills. */
.pfh-shimmer-once{
  position:relative; overflow:hidden;
}
.pfh-shimmer-once::after{
  content:""; position:absolute; top:0; bottom:0; left:-60%; width:60%;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%);
  animation: pfhShimmerSweep 2.4s var(--pfh-ease) 0.4s both;
  pointer-events:none;
}
@keyframes pfhShimmerSweep{
  0%   { left:-60%; }
  100% { left:120%; }
}

/* Eye-catcher: subtle 3D tilt on cards when hovered. Only fires on
 * pointer:fine so touch users don't see weird hover-stuck states. */
@media (hover:hover) and (pointer:fine){
  .feature:hover, .price-card:hover, .show-slide:hover, .pack-card:hover {
    transform: translateY(-3px) rotateX(2deg);
  }
}

/* ───── Accessibility classes ─────
 * Applied to <body> by pfh-bootstrap (injected by playground_server's
 * polish-html middleware) reading localStorage. Settings flip on /me. */

/* High-contrast: dark teal background, brand-soft text. Inverts the
 * generic page surfaces while leaving brand colours intact. */
body.pfh-hc {
  background: #0a1c14 !important;
  color: #d8f3dc !important;
}
body.pfh-hc .site-header,
body.pfh-hc header,
body.pfh-hc footer,
body.pfh-hc .card,
body.pfh-hc .pack-card,
body.pfh-hc .feature,
body.pfh-hc .price-card,
body.pfh-hc .show-slide,
body.pfh-hc section,
body.pfh-hc article {
  background: #0e2a1d !important;
  color: #d8f3dc !important;
  border-color: #1f3d2b !important;
}
body.pfh-hc a { color: #95d5b2 !important; }
body.pfh-hc a:hover { color: #d8f3dc !important; }
body.pfh-hc input,
body.pfh-hc textarea,
body.pfh-hc select {
  background: #061410 !important;
  color: #d8f3dc !important;
  border-color: #2d6a4f !important;
}

/* Dyslexia-friendly: OpenDyslexic if the user has it locally,
 * else Atkinson Hyperlegible (which we can web-load), else
 * fall back to Plus Jakarta Sans which is already loaded. */
body.pfh-dys {
  font-family: "Atkinson Hyperlegible", "OpenDyslexic", var(--pfh-font-body) !important;
  letter-spacing: .015em !important;
  word-spacing: .08em !important;
  line-height: 1.65 !important;
}
body.pfh-dys h1, body.pfh-dys h2, body.pfh-dys h3 {
  font-family: "Atkinson Hyperlegible", "OpenDyslexic", var(--pfh-font-body) !important;
  letter-spacing: -.01em !important;
}

/* Larger text: bumps base + headings 12.5% without breaking layout. */
body.pfh-lt { font-size: 18px; }
body.pfh-lt h1 { font-size: 2.6rem; }
body.pfh-lt h2 { font-size: 2.0rem; }
body.pfh-lt h3 { font-size: 1.5rem; }
body.pfh-lt p, body.pfh-lt li { font-size: 1.1rem; line-height: 1.7; }

/* Cards — soft drop shadow + smooth hover, only when no card already
 * has its own box-shadow defined. */
.card,
.gauge,
.access-card,
.pack-card,
.show-slide,
.value,
.value-card,
.col-box,
.diff-cell {
  box-shadow: var(--pfh-shadow-1);
  transition: box-shadow .18s var(--pfh-ease),
                  transform .18s var(--pfh-ease);
}
.pack-card:hover,
.value:hover,
.show-slide:hover {
  box-shadow: var(--pfh-shadow-2);
}

/* Buttons — consistent lift + subtle shadow on hover */
.btn,
.go,
button.btn-primary,
button.btn-urgency,
button.btn-secondary {
  transition: transform .12s var(--pfh-ease),
                  box-shadow .12s var(--pfh-ease),
                  background-color .12s var(--pfh-ease),
                  border-color .12s var(--pfh-ease);
  will-change: transform;
}
.btn:hover:not(:disabled),
.go:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--pfh-shadow-2);
}
.btn:active:not(:disabled),
.go:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--pfh-shadow-1);
}

/* Inputs / selects / textareas — brand-coloured focus ring */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  transition: border-color .15s var(--pfh-ease),
                  box-shadow .15s var(--pfh-ease);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45,106,79,.14);
}

/* Anchor focus ring (a11y) — green, not browser default blue */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2d6a4f;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Pills / tags — subtle outline + slight letter-spacing for tightness */
.pill, .tag, .show-tag, .ev-tag, .q-tag {
  letter-spacing: .02em;
}

/* Section headers in /me/* — small uppercase eyebrow above h2 lines
 * already used; ensure consistent line-height. */
h1, h2, h3, h4 {
  text-wrap: balance;
}

/* Table-of-contents-style lists across pages — uniform spacing */
ol, ul { padding-left: 22px; }

/* Selection colour — match brand */
::selection { background: #d8f3dc; color: #1f3d2b; }

/* Subtle scroll-shadow at the top of long card lists (when there are
 * many results) so the user sees there's more above. */
@supports (animation-timeline: scroll()) {
  body { scroll-behavior: smooth; }
}

/* Loading skeleton — used on first paint while data loads. Apply by
 * adding class="pfh-skel" to placeholder elements. */
.pfh-skel {
  background: linear-gradient(90deg,#eef0f3 0%,#f6f8fa 50%,#eef0f3 100%);
  background-size: 200% 100%;
  animation: pfhShimmer 1.4s linear infinite;
  color: transparent;
  border-radius: 6px;
}
@keyframes pfhShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Reduced-motion users get no transforms / shimmer — already
 * partially handled per-page; this is the catch-all. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print: hide chrome we never want on a printed CV / pack */
@media print {
  .show-arrow, .show-dots, .show-controls,
  .scroll-cta, .pfh-cookie-bar, .skip-link,
  nav, footer { display: none !important; }
  .card, .pack-card, .gauge { box-shadow: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
 * 2026-05 LAYOUT v2 — fixes "scattered" complaint:
 *   - Subnavs become real tab-bars (no more plain text rows)
 *   - Tighter vertical rhythm between site-header → subnav → content
 *   - Consistent .wrap max-width across candidate + admin pages
 *   - Page heroes look unified (gradient band on candidate-side,
 *     panel-style on admin)
 *   - Cards share radius + shadow
 * Selectors are conservative — :where() + max-width media so we don't
 * break existing pages with custom layouts.
 * ════════════════════════════════════════════════════════════════════ */

/* Pull every page subnav into a styled tab-bar. Matches the wizard's
 * `<nav class="subnav">` pattern — extends to admin nav.subnav too. */
nav.subnav,
.pfh-page-subnav nav {
  background: linear-gradient(180deg, #fafbfc, #f4f5f7);
  border: 1px solid #e6e8ec;
  border-radius: 11px;
  padding: 6px 8px !important;
  display: flex;
  gap: 2px !important;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  margin-bottom: 16px;
  box-shadow: var(--pfh-shadow-1);
}
nav.subnav > a,
.pfh-page-subnav nav > a {
  padding: 7px 13px !important;
  border-radius: 7px;
  color: var(--pfh-brand-2) !important;
  text-decoration: none !important;
  font-weight: 600;
  transition: all .15s var(--pfh-ease);
  white-space: nowrap;
  font-family: var(--pfh-font-body);
}
nav.subnav > a:hover,
.pfh-page-subnav nav > a:hover {
  background: rgba(45, 106, 79, .08);
  color: var(--pfh-brand) !important;
}
nav.subnav > a.active,
nav.subnav > a[aria-current="page"],
.pfh-page-subnav nav > a.active {
  background: var(--pfh-brand) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
/* Allow CTA-style pills inside the subnav (the "Browse matching jobs"
 * button on /me/cv) — they keep their inline styles. */
nav.subnav > a[style*="background"] {
  background: inherit;
  color: inherit !important;
}

/* Tighten the gap between unified site-header → subnav.
 * Currently the wrap top-padding stacks visually with the header band
 * making the page feel "scattered". Bring them closer. */
:where(.site-header[data-pfh-unified] + .pfh-page-subnav),
:where(.site-header[data-pfh-unified] + main),
:where(.site-header[data-pfh-unified] ~ .wrap){
  margin-top: 0 !important;
}
.wrap, .candidate-wrap, .admin-wrap {
  padding-top: 14px !important;
}

/* Standardise the candidate-side .wrap max-width to 1300px so pages
 * don't jump from 1100 → 1500 across navigation. */
body .wrap,
body .candidate-wrap {
  max-width: 1300px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Page hero band — opt-in via class="pfh-hero-band" on the H1 (or a
 * wrapper div). Pages without it keep their existing layout. */
.pfh-hero-band {
  background: linear-gradient(135deg, var(--pfh-brand) 0%, var(--pfh-brand-2) 60%, var(--pfh-brand-3) 100%);
  color: #fff !important;
  padding: 18px 24px !important;
  border-radius: 14px !important;
  margin: 0 0 14px !important;
  box-shadow: var(--pfh-shadow-2);
}
.pfh-hero-band h1 {
  color: #fff;
  font-family: var(--pfh-font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 4px;
}
.pfh-hero-band p, .pfh-hero-band .lede {
  color: rgba(255, 255, 255, .85);
  font-size: 13.5px;
  margin: 0;
  max-width: 820px;
}

/* Cards across the whole platform get a unified shadow/radius. */
.card, .panel, .gauge, .row-card, .req-card, .svc-card {
  border-radius: 12px !important;
  box-shadow: var(--pfh-shadow-1);
  transition: box-shadow .2s var(--pfh-ease);
}
.card:hover, .panel:hover, .svc-card:hover { box-shadow: var(--pfh-shadow-2); }

/* Buttons — all .btn variants get the same focus ring + transition */
.btn, button.btn, a.btn, .btn-primary, .btn.primary {
  transition: all .15s var(--pfh-ease) !important;
  font-family: var(--pfh-font-body) !important;
}
.btn:focus-visible, button.btn:focus-visible {
  outline: 3px solid rgba(45, 106, 79, .35) !important;
  outline-offset: 2px;
}

/* Scroll-margin so anchor jumps don't land under the sticky header */
:where(h1, h2, h3, h4):where([id]) { scroll-margin-top: 80px; }

/* Mobile: the subnav was overflowing horizontally on phones. Allow
 * horizontal scroll without breaking layout. */
@media (max-width: 720px) {
  nav.subnav,
  .pfh-page-subnav nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  nav.subnav > a,
  .pfh-page-subnav nav > a {
    flex-shrink: 0;
  }
}

