/* =================================================================
   Cloudvane — stylesheet
   Palette (from brand guide):
     Main      #4D91C6   Dark accent  #133951
     Light     #D3E4F1   Contrast/orange #CD7E4D
     Green #7FC844   Yellow #CEC153   Pink #C84B61
   ================================================================= */

:root {
  --blue:        #4D91C6;
  --blue-600:    #3a7db2;
  --navy:        #133951;
  --navy-700:    #0d2a3c;
  --light:       #D3E4F1;
  --light-50:    #eef6fc;
  --orange:      #CD7E4D;
  --green:       #7FC844;
  --yellow:      #CEC153;
  --pink:        #C84B61;

  --ink:         #16242e;
  --muted:       #5a6b78;
  --bg:          #ffffff;
  --bg-alt:      #f4f8fc;
  --border:      #e2e9f0;

  --radius:      18px;
  --radius-sm:   12px;
  --shadow:      0 1px 2px rgba(19,57,81,.06), 0 8px 24px rgba(19,57,81,.08);
  --shadow-lg:   0 20px 50px rgba(19,57,81,.16);
  --maxw:        1140px;

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; color: var(--navy); letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p  { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--blue); color: #fff; font-weight: 600; font-size: .98rem;
  padding: .7em 1.3em; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 6px 16px rgba(77,145,198,.32);
}
.btn:hover { background: var(--blue-600); text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(77,145,198,.4); }
.btn-sm { padding: .5em 1.05em; font-size: .92rem; box-shadow: none; }
.btn-lg { padding: .85em 1.7em; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--light-50); border-color: var(--blue); }
.btn-light { background: #fff; color: var(--navy); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.btn-light:hover { background: var(--light-50); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); box-shadow: none; }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 70px; }
.brand img { display: block; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--navy); font-weight: 600; font-size: .98rem; }
.nav-links a:not(.btn):hover { color: var(--blue); text-decoration: none; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--navy); border-radius: 2px; transition: .25s; }
.mobile-nav { display: none; flex-direction: column; padding: 0 22px; border-bottom: 1px solid var(--border); background: #fff; }
.mobile-nav a { padding: 14px 0; color: var(--navy); font-weight: 600; border-top: 1px solid var(--border); }
.mobile-nav.open { display: flex; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); background: linear-gradient(180deg, var(--light-50), #fff); }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.blob-1 { width: 420px; height: 420px; background: var(--blue); top: -120px; right: -80px; opacity: .28; }
.blob-2 { width: 360px; height: 360px; background: var(--light); bottom: -120px; left: -60px; opacity: .6; }
.blob-3 { width: 280px; height: 280px; background: var(--green); top: 40%; right: 30%; opacity: .12; }
.hero-inner { position: relative; z-index: 1; max-width: 820px; }
.eyebrow { display: inline-block; font-weight: 600; color: var(--blue-600); background: #fff; border: 1px solid var(--border); padding: .4em .9em; border-radius: 999px; font-size: .9rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.grad-text { background: linear-gradient(90deg, var(--blue), var(--navy)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 620px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 2.4rem; }
.hero-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 2.4rem; padding: 0; margin: 0; border-top: 1px solid var(--border); padding-top: 1.6rem; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.8rem; color: var(--navy); font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: .92rem; }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--blue); margin-bottom: .6rem; }
.section-eyebrow.on-dark { color: var(--light); }
.section-head { max-width: 640px; margin-bottom: 2.6rem; }
.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }

.check-list { list-style: none; padding: 0; margin: 1.4rem 0 0; }
.check-list li { position: relative; padding-left: 1.9rem; margin-bottom: .7rem; color: var(--ink); }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 1.3rem; height: 1.3rem; background: var(--light); color: var(--blue-600); border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }

/* portrait */
.portrait { margin: 0; }
.portrait-placeholder {
  aspect-ratio: 4/5; border-radius: var(--radius); display: grid; place-items: center; text-align: center;
  color: var(--blue-600); font-weight: 600;
  background: repeating-linear-gradient(135deg, var(--light) 0 12px, var(--light-50) 12px 24px);
  border: 2px dashed var(--blue); box-shadow: var(--shadow);
}
.portrait-placeholder small { color: var(--muted); font-weight: 400; }
.portrait img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center top; border-radius: var(--radius); box-shadow: var(--shadow); }
.portrait figcaption { margin-top: .8rem; text-align: center; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); margin-bottom: 1rem; }
.card h3 { margin-bottom: .4rem; }
.card p { margin: 0; }

/* projects */
.projects-grid { grid-template-columns: repeat(3, 1fr); }
.project-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-thumb {
  aspect-ratio: 16/9; background: linear-gradient(135deg, var(--light), var(--blue));
  position: relative; display: flex; align-items: flex-end; padding: 14px; overflow: hidden;
}
.project-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Book covers are portrait: show them whole (letterboxed) instead of cropped. */
.project-thumb.book-thumb img { object-fit: contain; padding: 14px; }
.project-thumb .chip { position: relative; z-index: 1; }
.project-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { margin-bottom: .35rem; }
.project-body p { flex: 0; }
.chip { display: inline-block; font-size: .78rem; font-weight: 700; color: #fff; padding: .25em .7em; border-radius: 999px; background: var(--navy); }
.chip-blue { background: var(--blue); }
.chip-green { background: var(--green); }
.chip-orange { background: var(--orange); }
.chip-pink { background: var(--pink); }
.tag-row { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .4rem 0 1rem; }
.tag-row li { font-size: .78rem; color: var(--muted); background: var(--bg-alt); border: 1px solid var(--border); padding: .2em .6em; border-radius: 6px; }
.link-arrow { margin-top: auto; font-weight: 600; color: var(--blue-600); }
.link-arrow span { transition: transform .2s ease; display: inline-block; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover span { transform: translateX(4px); }

/* ---------- CTA ---------- */
.cta-section { background: linear-gradient(135deg, var(--navy), var(--blue-600)); color: #fff; }
.cta-inner { max-width: 700px; text-align: center; margin-inline: auto; }
.cta-section h2 { color: #fff; }
.on-dark { color: var(--light); }
.cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin: 1.8rem 0 1rem; }
.cta-direct { color: var(--light); }
.cta-direct a { color: #fff; text-decoration: underline; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-700); color: #cfe0ee; padding: 2.6rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.site-footer img { filter: brightness(0) invert(1); opacity: .9; }
.site-footer .muted { color: #8aa6bd; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-links a { color: #cfe0ee; font-size: .95rem; }
.footer-links a:hover { color: #fff; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .cards, .projects-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .cards, .projects-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.4rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* generic legal/content pages */
.doc { max-width: 760px; padding-top: 2.5rem; padding-bottom: 4rem; }
.doc h1 { margin-bottom: 1.5rem; }
.doc h2 { font-size: 1.3rem; margin-top: 2rem; }
.doc a { word-break: break-word; }
.back-home { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; }

/* ===================== Cookie consent banner ===================== */
.cookie-consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 -8px 24px rgba(19, 57, 81, .18);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-block: 1rem;
  flex-wrap: wrap;
}
.cookie-consent-text {
  margin: 0;
  flex: 1 1 320px;
  font-size: .95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .92);
}
.cookie-consent-text a { color: #fff; text-decoration: underline; }
.cookie-consent-actions {
  display: flex;
  gap: .6rem;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .cookie-consent-actions { width: 100%; }
  .cookie-consent-actions .btn { flex: 1; }
}
