/* ScalaLingua website. Brand colours follow app/lib/src/brand/brand.dart. */

:root {
  --blue: #3ea8fb;
  --blue-soft: #d9eefe;
  --link: #0a5fa8;
  --cream: #fff4e0;
  --cream-deep: #fbe7c2;
  --navy: #1f2a44;
  --muted: #4a5672;
  --white: #ffffff;
  --green: #2e7d32;
  --error: #b3261e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(31, 42, 68, 0.10);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(780px, 100% - 2.5rem); }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--navy); color: var(--white); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font: inherit; font-weight: 700; text-decoration: none;
  color: var(--navy); background: var(--blue);
  border: 2px solid var(--blue); border-radius: 999px;
  box-shadow: 0 4px 0 #1f7fcc;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.button:hover { color: var(--navy); background: #5ab6fc; transform: translateY(-1px); box-shadow: 0 5px 0 #1f7fcc; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 #1f7fcc; }
.button-large { padding: 1rem 2rem; font-size: 1.15rem; }
.button-small { padding: 0.45rem 1rem; font-size: 0.95rem; box-shadow: 0 3px 0 #1f7fcc; }
.button-ghost { background: transparent; border-color: var(--navy); box-shadow: none; }
.button-ghost:hover { background: rgba(31, 42, 68, 0.06); box-shadow: none; }
.button-light { background: var(--white); border-color: var(--white); box-shadow: 0 4px 0 var(--cream-deep); }
.button-light:hover { background: var(--cream); box-shadow: 0 5px 0 var(--cream-deep); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255, 244, 224, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid rgba(31, 42, 68, 0.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--navy); font-size: 1.35rem; font-weight: 600; }
.brand b { color: #1f7fcc; font-weight: 800; }
.brand:hover { color: var(--navy); }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav > a:not(.button) { color: var(--navy); text-decoration: none; font-weight: 600; }
.nav > a:not(.button):hover, .nav > a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
@media (max-width: 720px) {
  .nav { gap: 0.9rem; }
  .nav > a:not(.button) { display: none; }
}

/* Language menu: a disclosure, since the site runs no JavaScript. */
.lang-menu { position: relative; }
.lang-menu summary {
  display: flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.5rem;
  list-style: none; cursor: pointer; font-weight: 600; border-radius: 8px;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after {
  content: ""; width: 0.4rem; height: 0.4rem; margin-left: 0.1rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
}
.lang-menu[open] summary::after { transform: translateY(0.1rem) rotate(-135deg); }
.lang-menu summary:hover { background: rgba(31, 42, 68, 0.06); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 6;
  min-width: 11rem; margin: 0; padding: 0.4rem; list-style: none;
  background: var(--white); border: 1px solid var(--cream-deep); border-radius: 12px; box-shadow: var(--shadow);
}
.lang-menu a { display: block; padding: 0.45rem 0.8rem; border-radius: 8px; color: var(--navy); text-decoration: none; }
.lang-menu a:hover { background: var(--cream); }
.lang-menu a[aria-current] { font-weight: 700; background: var(--blue-soft); }
@media (max-width: 480px) {
  .lang-current { display: none; }
}

/* Hero */
.hero {
  background:
    radial-gradient(circle at 85% 20%, var(--blue-soft) 0, transparent 40%),
    var(--cream);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.eyebrow {
  display: inline-block; margin-bottom: 1rem; padding: 0.3rem 0.9rem;
  background: var(--white); border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 2px 0 var(--cream-deep);
}
.accent { color: #1f7fcc; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 38em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.8rem 0 1rem; }
.cta-centre { justify-content: center; }
.cta-note { font-size: 0.95rem; color: var(--muted); }

.hero-art { position: relative; min-height: 360px; display: grid; place-items: center; }
.ladder {
  position: absolute; inset: 0 22%;
  border-left: 12px solid #e0d3bc; border-right: 12px solid #e0d3bc; border-radius: 6px;
  display: flex; flex-direction: column; justify-content: space-evenly;
}
.ladder span { display: block; height: 12px; background: #e0d3bc; border-radius: 6px; }
.ladder span:nth-child(-n+2) { background: var(--green); opacity: 0.85; }
.hero-scala {
  position: relative; width: min(320px, 80%);
  filter: drop-shadow(0 18px 24px rgba(31, 42, 68, 0.18));
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-10px); } }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .lead { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .hero-art { min-height: 260px; order: -1; }
  .hero-scala { width: 200px; }
}

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-tint { background: var(--cream); }
.section-title { text-align: center; }
.section-lead { text-align: center; color: var(--muted); max-width: 40em; margin: 0 auto 2.5rem; font-size: 1.15rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.steps li {
  position: relative; background: var(--white); border: 2px solid var(--cream-deep);
  border-radius: var(--radius); padding: 2.2rem 1.5rem 1.5rem;
}
.step-num {
  position: absolute; top: -1.2rem; left: 1.5rem;
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  background: var(--blue); color: var(--navy); font-weight: 800; border-radius: 50%;
  box-shadow: 0 3px 0 #1f7fcc;
}
.steps p { color: var(--muted); margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.feature { background: var(--white); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.feature h3 { display: flex; align-items: center; gap: 0.6rem; }
.feature h3::before {
  content: ""; flex: none; width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft);
}
.feature p { color: var(--muted); margin: 0; }

@media (max-width: 860px) {
  .steps, .features { grid-template-columns: 1fr; }
  .steps { gap: 2.2rem; }
}
@media (min-width: 600px) and (max-width: 860px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}

.course {
  display: grid; grid-template-columns: 180px 1fr; gap: 2rem; align-items: center;
  margin: 2rem auto 0; max-width: 860px;
  background: var(--white); border: 2px solid var(--cream-deep); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow);
}
.course-flag { display: flex; height: 120px; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(31, 42, 68, 0.15); }
.course-flag span { flex: 1; }
img.course-flag { width: 100%; object-fit: cover; }
.course-flag-it span:nth-child(1) { background: #009246; }
.course-flag-it span:nth-child(2) { background: #f1f2f1; }
.course-flag-it span:nth-child(3) { background: #ce2b37; }
.facts { list-style: none; padding: 0; margin: 0 0 1.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.facts li { background: var(--cream); border-radius: 999px; padding: 0.25rem 0.9rem; font-size: 0.95rem; }
.more { text-align: center; margin-top: 2rem; color: var(--muted); }
@media (max-width: 640px) {
  .course { grid-template-columns: 1fr; text-align: center; }
  .course-flag { width: 160px; margin: 0 auto; }
  .facts { justify-content: center; }
}

.characters { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.characters li {
  width: 120px; height: 120px; padding: 12px; background: var(--white); border-radius: 28px;
  box-shadow: var(--shadow); transition: transform 0.2s ease;
}
.characters li:hover { transform: translateY(-6px) rotate(-3deg); }

.cta-band { background: var(--navy); color: var(--white); text-align: center; }
.cta-band p { color: #d5dbea; font-size: 1.15rem; }
.cta-band-inner { display: flex; flex-direction: column; align-items: center; }

/* Content pages */
.page { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page-centred { text-align: center; }
.page-centred img { margin: 0 auto 1.5rem; }
.page-centred .lead { margin-inline: auto; }

.doc h2 { margin-top: 2.2em; font-size: 1.5rem; scroll-margin-top: 90px; }
.doc h3 { margin-top: 1.6em; scroll-margin-top: 90px; }
.doc li { margin-bottom: 0.4em; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc address { font-style: normal; margin-bottom: 1em; }
.doc code { background: var(--cream); padding: 0.1em 0.35em; border-radius: 5px; font-size: 0.92em; }
.meta { color: var(--muted); font-size: 0.95rem; }
.toc { background: var(--cream); border-radius: var(--radius); padding: 1.2rem 1.6rem; margin: 2rem 0; }
.toc h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.toc ol { margin: 0; columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--cream-deep); }
th { background: var(--cream); }

/* Forms */
.form { background: var(--cream); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem); margin: 2rem 0; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--navy);
  padding: 0.7rem 0.9rem; background: var(--white);
  border: 2px solid #d9c9a8; border-radius: 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--blue-soft); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-weight: 600; margin: 0.35rem 0 0; font-size: 0.95rem; }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0.5rem 0 0; }
.form .button { margin-top: 0.5rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.notice { border-radius: 12px; padding: 1rem 1.2rem; margin: 1.5rem 0; background: var(--blue-soft); }
.notice p { margin: 0; }
.notice-error { background: #fde8e6; color: #6e1610; }
.notice-error a { color: #6e1610; }

.contact-more { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; }
.contact-more h2 { font-size: 1.2rem; }
@media (max-width: 640px) { .contact-more { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--cream); padding: 3rem 0 1.5rem; margin-top: 0; border-top: 1px solid var(--cream-deep); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-brand p { color: var(--muted); margin: 0.6rem 0 1rem; }
.linkedin { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; color: #0a66c2; }
.linkedin svg { flex: none; }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 0.6rem 2.5rem; align-content: start; }
.footer-links a { color: var(--navy); text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }
.footer-small { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--cream-deep); font-size: 0.88rem; color: var(--muted); }
.footer-small p { margin: 0 0 0.4rem; }
.footer-small a { color: var(--muted); }
