/* Shared foundation for every CV theme: reset, accessibility, reveal motion,
   lightbox, contact-form skeleton and the admin preview bar. Themes add the look. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: clip; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, picture, svg, video { display: block; max-width: 100%; }
picture, picture img { width: 100%; height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
/* Native UI (scrollbars, form controls, autofill) follows the dark palettes */
@media screen {
  :root[data-theme="aurora"], :root[data-theme="editorial"], :root[data-theme="minimal"][data-mode="dark"], :root[data-theme="bento"][data-mode="dark"] { color-scheme: dark; }
}
@media screen and (prefers-color-scheme: dark) {
  :root[data-theme="minimal"]:not([data-mode="light"]), :root[data-theme="bento"]:not([data-mode="light"]) { color-scheme: dark; }
}
[dir="rtl"] .fa-arrow-right, [dir="rtl"] .fa-arrow-up-right-from-square, [dir="rtl"] .fa-arrow-right-long, [dir="rtl"] .fa-chevron-right { transform: scaleX(-1); }

.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; }
.cv-skip { position: fixed; inset-inline-start: 12px; top: -60px; z-index: 2000; padding: 10px 16px; border-radius: 8px; background: #111; color: #fff; font-size: 14px; transition: top .2s; }
.cv-skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Reveal on scroll (only when JS is running). Hero blocks never carry data-reveal, so the
   name and photo paint at once. Fail-safe: if cv.js never arrives (blocked, network error)
   the CSS animation below shows everything after 2.5 s; cv.js adds html.cv-ready, which
   switches the fail-safe off so normal scroll reveals take over. */
html.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 70ms); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }
html.js:not(.cv-ready) [data-reveal]:not(.is-in), html.js:not(.cv-ready) .au-meter i, html.js:not(.cv-ready) .jr-bar i, html.js:not(.cv-ready) .ed-skill-col li > i::after { animation: cv-failsafe .6s ease 2.5s forwards; }
@keyframes cv-failsafe { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* Availability pulse */
.cv-dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
.cv-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: cv-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes cv-ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }

/* Project monogram when no image */
.cv-mono { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: radial-gradient(120% 120% at 0% 0%, rgba(var(--accent-rgb), .28), rgba(var(--accent-rgb), .06)); }

/* Contact form skeleton */
.cv-hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.cv-form { display: grid; gap: 14px; }
.cv-form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .cv-form-row { grid-template-columns: 1fr; } }
.cv-field { display: grid; gap: 6px; font-size: 13px; }
.cv-field input, .cv-field textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(127, 127, 127, .3); background: transparent; font-size: 15px; line-height: 1.5; transition: border-color .2s, box-shadow .2s; }
.cv-field input[type="email"] { direction: ltr; }
[dir="rtl"] .cv-field input[type="email"] { text-align: right; }
.cv-field textarea { resize: vertical; min-height: 130px; }
.cv-field input:focus, .cv-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.cv-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cv-form-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent, #fff); font-weight: 600; font-size: 15px; transition: transform .15s, filter .2s, opacity .2s; }
.cv-form-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cv-form-btn[disabled] { opacity: .65; pointer-events: none; }
.cv-form-wa { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; opacity: .85; }
.cv-form-wa:hover { opacity: 1; text-decoration: underline; }
.cv-form-wa i { color: #25d366; font-size: 18px; }
.cv-form-status { min-height: 1.4em; font-size: 14px; margin: 0; }
.cv-form-status.is-ok { color: #16a34a; }
.cv-form-status.is-err { color: #dc2626; }

/* Lightbox */
.cv-lb { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 56px 16px; background: rgba(6, 7, 10, .92); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.cv-lb.is-open { opacity: 1; visibility: visible; }
.cv-lb figure { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(1100px, 100%); }
.cv-lb img { max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); background: #fff; }
.cv-lb figcaption { color: #e7e7ea; font-size: 15px; text-align: center; line-height: 1.5; max-width: 700px; }
.cv-lb figcaption small { display: block; color: #a1a1aa; font-size: 13px; }
.cv-lb-btn { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; font-size: 18px; transition: background .2s; }
.cv-lb-btn:hover { background: rgba(255, 255, 255, .2); }
.cv-lb-close { top: 14px; inset-inline-end: 14px; }
.cv-lb-prev { inset-inline-start: 14px; top: 50%; transform: translateY(-50%); }
.cv-lb-next { inset-inline-end: 14px; top: 50%; transform: translateY(-50%); }
[dir="rtl"] .cv-lb-prev i, [dir="rtl"] .cv-lb-next i { transform: scaleX(-1); }
@media (max-width: 640px) { .cv-lb-prev, .cv-lb-next { top: auto; bottom: 14px; transform: none; } }
body.cv-noscroll { overflow: hidden; }

/* Admin preview banner */
.cv-preview-bar { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 1400; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: #111827; color: #fde68a; font: 500 13px/1.3 system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); white-space: nowrap; }
.cv-preview-bar strong { color: #fff; }

/* Shared print basics (Executive has its own A4 rules) */
@media print {
  html { scroll-behavior: auto; }
  .cv-preview-bar, .cv-skip, .cv-lb, form.cv-form, [data-noprint] { display: none !important; }
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .au-meter i, .jr-bar i, .ed-skill-col li > i::after { transform: none !important; }
  a { text-decoration: none !important; }
}

/* Company card (cv_company_card) — neutral layout; each theme restyles .cv-co */
.cv-co { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; padding: 8px 14px 8px 8px; border: 1px solid rgba(127, 127, 127, .25); border-radius: 14px; text-decoration: none; transition: border-color .2s, transform .2s; }
[dir="rtl"] .cv-co { padding: 8px 8px 8px 14px; }
a.cv-co:hover { border-color: var(--accent); transform: translateY(-1px); }
.cv-co-logo { display: block; width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 50%; }
.cv-co-logo img, .cv-co-logo picture { width: 100%; height: 100%; object-fit: cover; }
.cv-co-logo .cv-mono { font-size: 15px; border-radius: 50%; }
.cv-co-text { display: grid; min-width: 0; line-height: 1.35; }
.cv-co-text small { font-size: 12px; opacity: .7; }
.cv-co-text strong { font-size: 14.5px; font-weight: 600; }
.cv-co-text em { font-size: 12.5px; font-style: normal; opacity: .75; }
.cv-co-go { font-size: 11px; opacity: .6; margin-inline-start: 4px; }
