/* ==========================================================================
   TOTALLY MALDIVES — core stylesheet
   Design language: lagoon teal + horizon coral + driftwood brown,
   Fraunces (display serif) + Manrope (body/UI) + IBM Plex Mono (atoll index)
   ========================================================================== */

:root {
  /* --- Palette (drawn from the logo) --- */
  --lagoon: #0EA5BE;
  --lagoon-deep: #0B6478;
  --lagoon-ink: #0F2E33;
  --horizon-coral: #F4A98C;
  --horizon-coral-soft: #FBD9C9;
  --driftwood: #B97850;
  --driftwood-deep: #8C5638;
  --paper: #F5F9F8;       /* pale seafoam-white, not cream */
  --paper-raised: #FFFFFF;
  --sand: #E9E2D2;
  --ink: #123338;
  --ink-soft: #3E5B60;
  --line: #D8E6E4;

  /* --- Type --- */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* --- Rhythm --- */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15,46,51,0.06), 0 8px 24px -12px rgba(15,46,51,0.18);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--lagoon-ink); margin: 0 0 0.5em; font-weight: 600; line-height: 1.15; }
p { margin: 0 0 1em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

:focus-visible {
  outline: 3px solid var(--horizon-coral);
  outline-offset: 2px;
}

/* --- Skip link --- */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--lagoon-ink); color: #fff;
  padding: 12px 20px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Ticker bar
   -------------------------------------------------------------------------- */
.ticker {
  background: var(--lagoon-ink);
  color: #cfe9ea;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.ticker__track {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  padding: 9px 24px;
  animation: ticker-scroll 38s linear infinite;
  width: max-content;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: 8px; opacity: 0.92; }
.ticker__item b { color: #fff; font-weight: 600; }
.ticker__dot { color: var(--horizon-coral); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand img { height: 40px; width: auto; }
.brand__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  padding-left: 12px;
  display: none;
}
@media (min-width: 720px) { .brand__tag { display: block; } }

.main-nav { display: none; }
.main-nav ul { display: flex; gap: 2px; }
.main-nav a {
  display: block;
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--paper); color: var(--lagoon-deep); }
@media (min-width: 980px) { .main-nav { display: block; } }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  cursor: pointer;
  color: var(--lagoon-deep);
}
.icon-btn:hover { background: var(--paper); }
.menu-toggle { display: inline-flex; }
@media (min-width: 980px) { .menu-toggle { display: none; } }

/* --- Mobile drawer --- */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  visibility: hidden;
}
.mobile-drawer[data-open="true"] { visibility: visible; }
.mobile-drawer__scrim {
  position: absolute; inset: 0; background: rgba(15,46,51,0.45);
  opacity: 0; transition: opacity 0.2s;
}
.mobile-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(320px, 88vw);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: 20px;
  overflow-y: auto;
}
.mobile-drawer[data-open="true"] .mobile-drawer__scrim { opacity: 1; }
.mobile-drawer[data-open="true"] .mobile-drawer__panel { transform: translateX(0); }
.mobile-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mobile-drawer a {
  display: block; padding: 12px 4px; font-weight: 600; font-size: 16px;
  border-bottom: 1px solid var(--line); color: var(--ink);
}

/* --------------------------------------------------------------------------
   Search modal
   -------------------------------------------------------------------------- */
.search-modal {
  position: fixed; inset: 0; z-index: 300; visibility: hidden;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 20px 0;
}
.search-modal[data-open="true"] { visibility: visible; }
.search-modal__scrim { position: absolute; inset: 0; background: rgba(15,46,51,0.55); opacity: 0; transition: opacity .2s; }
.search-modal[data-open="true"] .search-modal__scrim { opacity: 1; }
.search-modal__box {
  position: relative; width: 100%; max-width: 560px;
  background: var(--paper-raised); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; transform: translateY(-8px); opacity: 0; transition: all .2s;
}
.search-modal[data-open="true"] .search-modal__box { transform: translateY(0); opacity: 1; }
.search-modal__row { display: flex; gap: 10px; align-items: center; border-bottom: 2px solid var(--line); padding-bottom: 12px; }
.search-modal input {
  flex: 1; border: none; outline: none; font-size: 18px; font-family: var(--font-body);
  background: transparent; color: var(--ink);
}
.search-modal__hint { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); margin-top: 10px; }
.search-results { margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.search-results a {
  display: block; padding: 10px 8px; border-radius: var(--radius-sm);
}
.search-results a:hover, .search-results a.is-active { background: var(--paper); }
.search-results .r-title { font-weight: 700; color: var(--lagoon-ink); }
.search-results .r-desc { font-size: 13px; color: var(--ink-soft); }
.search-results .r-empty { padding: 16px 8px; color: var(--ink-soft); font-size: 14px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #EAF6F3 0%, var(--paper) 65%);
}
.hero__inner {
  padding: 64px 24px 40px;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: 36px;
}
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding-top: 84px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--driftwood-deep);
  background: var(--horizon-coral-soft);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 18px;
}
.eyebrow::before { content: "◆"; color: var(--horizon-coral); font-size: 9px; }

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  max-width: 16ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--lagoon);
}
.hero__lede { font-size: 1.13rem; color: var(--ink-soft); max-width: 46ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--lagoon); color: #fff; box-shadow: 0 6px 20px -8px rgba(14,165,190,0.6); }
.btn-primary:hover { background: var(--lagoon-deep); }
.btn-ghost { background: transparent; border-color: var(--lagoon); color: var(--lagoon-deep); }
.btn-ghost:hover { background: var(--paper-raised); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }

.hero__art { position: relative; }
.hero__art-img { width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.tideline { width: 100%; height: auto; }

/* --- Stat strip --- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
}
@media (min-width: 640px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stat-strip__item { background: var(--paper-raised); padding: 16px 14px; text-align: left; }
.stat-strip__num { font-family: var(--font-display); font-size: 1.7rem; color: var(--lagoon-ink); display: block; }
.stat-strip__label { font-size: 12px; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Section scaffolding
   -------------------------------------------------------------------------- */
.section { padding: 56px 0; }
.section--tight { padding: 36px 0; }
.section--alt { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { max-width: 640px; margin-bottom: 32px; }
.section__kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--lagoon-deep); text-transform: uppercase; display: block; margin-bottom: 10px;
}
.section__head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section__sub { color: var(--ink-soft); font-size: 1.02rem; }
.section__foot { margin-top: 28px; }

/* --- Atoll quick-jump strip --- */
.atoll-strip {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 700px) { .atoll-strip { grid-template-columns: repeat(4, 1fr); } }
.atoll-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .15s, transform .15s;
}
.atoll-card:hover { border-color: var(--lagoon); transform: translateY(-2px); }
.atoll-card__code {
  font-family: var(--font-mono); font-size: 11px; color: var(--driftwood-deep);
  background: var(--horizon-coral-soft); display: inline-block; padding: 2px 8px; border-radius: 5px;
  margin-bottom: 10px;
}
.atoll-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.atoll-card p { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 0; }

/* --- Department directory cards --- */
.dept-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .dept-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .dept-grid { grid-template-columns: repeat(3, 1fr); } }

.dept-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.dept-card:hover { transform: translateY(-3px); }
.dept-card__code {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--lagoon-deep); display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.dept-card__code .glyph { font-size: 18px; }
.dept-card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.dept-card p { color: var(--ink-soft); font-size: 14.5px; flex-grow: 1; }
.dept-card__links { margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.dept-card__links a { font-size: 14px; font-weight: 600; color: var(--lagoon-deep); }
.dept-card__links a:hover { text-decoration: underline; }
.dept-card__more { margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--driftwood-deep); }
.dept-card__more:hover { text-decoration: underline; }

/* --- Recent updates board --- */
.board { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper-raised); }
.board__row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.board__row:last-child { border-bottom: none; }
.board__tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 5px; background: var(--paper); color: var(--lagoon-deep);
  flex-shrink: 0; white-space: nowrap;
}
.board__tag--new { background: var(--horizon-coral-soft); color: var(--driftwood-deep); }
.board__title { flex-grow: 1; font-weight: 600; }
.board__title a:hover { text-decoration: underline; }
.board__when { color: var(--ink-soft); font-size: 13px; flex-shrink: 0; }

/* --- Progress / growth callout --- */
.growth {
  display: grid; gap: 28px;
  background: var(--lagoon-ink);
  color: #dff2f2;
  border-radius: var(--radius);
  padding: 32px;
}
@media (min-width: 860px) { .growth { grid-template-columns: 1.2fr 0.8fr; align-items: center; } }
.growth h2 { color: #fff; }
.growth p { color: #b9dbdb; }
.growth-bar { background: rgba(255,255,255,0.12); border-radius: 999px; height: 10px; overflow: hidden; margin: 18px 0 10px; }
.growth-bar__fill { background: var(--horizon-coral); height: 100%; border-radius: 999px; }
.growth-nums { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12.5px; color: #9fc7c7; }

/* --------------------------------------------------------------------------
   Content page layout (guide pages)
   -------------------------------------------------------------------------- */
.page-head { padding: 40px 0 8px; }
.breadcrumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; font-family: var(--font-mono); }
.breadcrumbs a:hover { text-decoration: underline; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 24ch; }
.page-head__meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); margin-top: 10px; }

.content-layout { display: grid; gap: 40px; padding: 24px 0 64px; }
@media (min-width: 960px) { .content-layout { grid-template-columns: 2fr 1fr; } }

.prose { font-size: 16.5px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.3em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--lagoon); }
.callout {
  background: var(--paper-raised); border: 1px solid var(--line); border-left: 4px solid var(--lagoon);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 1.6em 0; font-size: 15px;
}
.callout strong { color: var(--lagoon-deep); }

.sidebar-card {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.sidebar-card h4 {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--lagoon-deep); margin-bottom: 12px;
}
.sidebar-card ul li { margin-bottom: 10px; }
.sidebar-card a { font-size: 14.5px; font-weight: 600; }
.sidebar-card a:hover { text-decoration: underline; }

.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.share-row a {
  font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-raised);
}
.share-row a:hover { border-color: var(--lagoon); color: var(--lagoon-deep); }

/* --------------------------------------------------------------------------
   Directory hub page (department landing)
   -------------------------------------------------------------------------- */
.guide-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .guide-grid { grid-template-columns: repeat(2, 1fr); } }
.guide-card {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; transition: border-color .15s, transform .15s;
}
.guide-card:hover { border-color: var(--lagoon); transform: translateY(-2px); }
.guide-card__num { font-family: var(--font-mono); font-size: 11.5px; color: var(--driftwood-deep); }
.guide-card h3 { font-size: 1.1rem; margin: 6px 0 6px; }
.guide-card p { color: var(--ink-soft); font-size: 14px; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--lagoon-ink); color: #b9dbdb; padding: 56px 0 28px; margin-top: 40px; }
.footer-top { display: grid; gap: 36px; grid-template-columns: 1fr; margin-bottom: 40px; }
@media (min-width: 780px) { .footer-top { grid-template-columns: 1.4fr repeat(4, 1fr); } }
.footer-brand img { height: 34px; margin-bottom: 14px; }
.footer-brand p { font-size: 14px; color: #9fc7c7; max-width: 32ch; }
.footer-col h5 {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; margin-bottom: 14px;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14px; color: #b9dbdb; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  font-size: 13px; color: #7fb0b0;
}
.footer-bottom a:hover { color: #fff; }
.lang-note {
  font-family: var(--font-mono); font-size: 11.5px; color: #6fa3a3;
  border: 1px dashed rgba(255,255,255,0.2); border-radius: 999px; padding: 5px 12px;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.error-page { text-align: center; padding: 100px 24px; }
.error-page .code { font-family: var(--font-mono); font-size: 14px; color: var(--driftwood-deep); }
.error-page h1 { font-size: clamp(2rem, 6vw, 3.5rem); margin: 10px 0; }

/* Utility */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
