/* Veilora: brand design, typography, layout and reusable components. */
:root {
  --orange: #C2410C;
  --orange-dark: #9A3412;
  --orange-soft: #FFEDD5;
  --cream: #FFF8F0;
  --charcoal: #231F1B;
  --muted: #5C534B;
  --white: #FFFFFF;
  --neutral: #F6F1EB;
  --border: #E8DCCF;
  --focus: #1E3A8A;
  --ok: #166534;
  --ok-bg: #ECFDF3;
  --warn: #92400E;
  --warn-bg: #FEF3C7;
  --err: #991B1B;
  --err-bg: #FEF2F2;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(35, 31, 27, .06), 0 4px 14px rgba(35, 31, 27, .06);
  --space: 1rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 70ch;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; color: var(--charcoal); background: var(--cream); }
[hidden] { display: none !important; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; }
p, ul, ol { margin: 0 0 1.1em; }
a { color: var(--orange-dark); text-underline-offset: .18em; }
a:hover { color: var(--orange); }
code, kbd, samp { font-family: var(--font-mono); font-size: .92em; background: var(--neutral); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
main:focus { outline: none; }
.container { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.skip-link { position: absolute; left: .5rem; top: -4rem; background: var(--charcoal); color: var(--white); padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: .5rem; color: var(--white); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.25rem; color: var(--charcoal); text-decoration: none; }
.brand:hover { color: var(--orange-dark); }
.primary-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: .5rem .85rem; border-radius: var(--radius-sm); color: var(--charcoal); text-decoration: none; font-weight: 550; }
.primary-nav a:hover { background: var(--orange-soft); }
.primary-nav a[aria-current="page"] { background: var(--orange-soft); color: var(--orange-dark); }
.nav-toggle { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.25rem; border-radius: var(--radius-sm); border: 2px solid var(--orange); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.2; min-height: 2.75rem; }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: var(--white); }
.btn-secondary { background: transparent; color: var(--orange-dark); }
.btn-secondary:hover { background: var(--orange-soft); color: var(--orange-dark); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* Page layout */
.page { padding-block: 1.5rem 4rem; }
.page-article { max-width: 60rem; }
.page-head { margin-bottom: 1.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--orange-dark); margin-bottom: .5rem; }
.meta { color: var(--muted); font-size: .95rem; }
.lead { font-size: 1.25rem; line-height: 1.55; color: var(--charcoal); max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose > h2:first-child { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: .45em; }
.callout { background: var(--orange-soft); border-left: 4px solid var(--orange); padding: .9rem 1.1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.breadcrumbs { margin-bottom: 1.25rem; font-size: .92rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--border); }
.toc { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; max-width: var(--measure); margin-bottom: 1rem; }
.toc h2 { font-size: 1rem; margin: 0 0 .5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: .25em; break-inside: avoid; }
.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--neutral); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.faq details { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .6rem; padding: 0 1rem; }
.faq summary { cursor: pointer; font-weight: 650; padding: .85rem 0; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: .75rem; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35em; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; }
.card .badge { margin-bottom: .6rem; }
.related { margin-top: 2.5rem; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok); border: 1px solid #BBF7D0; }
.badge-edu { background: var(--warn-bg); color: var(--warn); border-color: #FDE68A; }
.badge-plan { background: var(--neutral); color: var(--muted); border-color: var(--border); }
.icon-lg { width: 3.5rem; height: 3.5rem; margin-bottom: .6rem; }

/* Home */
.hero { padding-block: 3rem 3.5rem; background: linear-gradient(180deg, var(--cream), var(--orange-soft)); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero .lead { margin-bottom: 1.5rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.section { padding-block: 3.5rem; }
.section-alt { background: var(--white); border-block: 1px solid var(--border); }
.section > .container > h2, .section-alt > .container > h2 { margin-top: 0; }
.section-intro { max-width: var(--measure); color: var(--muted); margin-bottom: 1.5rem; }
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; }
.principles div { border-top: 3px solid var(--orange); padding-top: .75rem; }
.principles h3 { margin-bottom: .3em; }
.principles p { color: var(--muted); margin: 0; }

/* Forms (shared) */
.form-row { margin-bottom: 1.1rem; }
label, .label { display: block; font-weight: 650; margin-bottom: .3rem; }
.hint { color: var(--muted); font-size: .92rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], select, textarea { width: 100%; font: inherit; color: inherit; background: var(--white); border: 2px solid #CDBFAF; border-radius: var(--radius-sm); padding: .6rem .75rem; min-height: 2.75rem; }
textarea { min-height: 9rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1.25rem; }
.alert-ok { background: var(--ok-bg); border-color: #BBF7D0; color: var(--ok); }
.alert-err { background: var(--err-bg); border-color: #FECACA; color: var(--err); }

/* Footer */
.site-footer { background: var(--charcoal); color: #EDE6DE; padding-block: 3rem 2rem; }
.site-footer a { color: #FFD9B8; }
.site-footer a:hover { color: var(--white); }
.site-footer .brand { color: var(--white); }
.footer-top { display: grid; grid-template-columns: 1.2fr 3fr; gap: 2.5rem; }
.footer-brand p { color: #CFC4B9; font-size: .95rem; margin-top: .75rem; }
.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.5rem; }
.footer-nav h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .6rem; color: var(--white); }
.footer-nav ul { list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin-bottom: .35rem; font-size: .95rem; }
.footer-bottom { border-top: 1px solid #4A423B; margin: 2rem 0 0; padding-top: 1.25rem; font-size: .9rem; color: #CFC4B9; }
.cookie-notice { background: var(--white); border-top: 1px solid var(--border); padding: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .btn, .card, .callout { border: 1px solid CanvasText; }
}
.card-title { font-size: 1.2rem; margin: 0 0 .4em; }
.references li { overflow-wrap: anywhere; }

/* PWA install prompt */
.install-banner { position: fixed; left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 34rem; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; background: var(--white); border: 2px solid var(--orange); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(35, 31, 27, .22); padding: .9rem 1rem; }
.install-text { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 16rem; font-size: .95rem; }
.install-text span { color: var(--muted); }
.install-actions { display: flex; gap: .5rem; }
.btn-sm { padding: .35rem .75rem; min-height: 2.25rem; font-size: .9rem; }
.footer-maintainer { margin: 1.25rem 0 0; font-size: .95rem; }
.footer-bottom .btn { margin-left: .75rem; color: #FFD9B8; border-color: #FFD9B8; }
.footer-bottom .btn:hover { background: #4A423B; color: var(--white); }
@media print { .install-banner { display: none !important; } }
