:root {
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-soft: #f7f8fa;
  --ink: #17202a;
  --muted: #687382;
  --line: #d5dbe3;
  --brand: #374151;
  --accent: #c26a2e;
  --accent-soft: #fff0e8;
  --good: #20795a;
  --shadow: 0 18px 45px rgba(18, 33, 52, 0.13);
  --radius: 20px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 42%, #dfe5eb 100%);
  font-family: var(--font);
}

button, input { font: inherit; }

.hidden { display: none !important; }

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.login-logo { width: 56px; height: 56px; margin-bottom: 18px; }
.login-card h1 { margin: 0 0 10px; font-size: 30px; letter-spacing: -0.04em; }
.muted { color: var(--muted); line-height: 1.5; }
.fine-print { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.error { min-height: 20px; color: #a73321; font-weight: 700; }

.login-card form { display: grid; gap: 10px; margin-top: 18px; }
.login-card label { font-size: 13px; color: var(--muted); font-weight: 700; }
.login-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.login-card button {
  padding: 13px 14px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(180deg, #f6f7f8, #d7dde5);
  box-shadow: 12px 0 35px rgba(18, 33, 52, 0.07);
  display: flex;
  flex-direction: column;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand img { width: 42px; height: 42px; }
.brand strong { display: block; font-size: 18px; }
.brand span { color: var(--muted); font-size: 12px; }

.nav-list { display: grid; gap: 12px; }
.nav-item {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border: 1px solid #c8ced6;
  border-left: 5px solid transparent;
  border-radius: 14px;
  background: linear-gradient(180deg, #f5f6f7, #d6dbe1);
  color: #27313c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  cursor: pointer;
  font-weight: 750;
}

.nav-item:hover, .nav-item.active {
  border-left-color: var(--accent);
  background: #ffffff;
  transform: translateX(2px);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  color: var(--muted);
  display: grid;
  gap: 4px;
}
.sidebar-footer strong { color: var(--ink); }

.main-content { padding: 30px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 26px;
}

.hero > div:first-child, .status-card, .panel, .placeholder-panel, .compact-section-header, .media-card, .contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
}

.hero > div:first-child { padding: 21px; }
.hero h1 { margin: 3px 0 8px; font-size: clamp(30px, 4.5vw, 50px); line-height: .92; letter-spacing: -0.06em; }
.hero-copy { max-width: 770px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.4; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.horizon-ribbon {
  height: 112px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #eef3f6;
  overflow: hidden;
}
.horizon-ribbon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.distant-ridge { fill: rgba(103, 115, 130, .18); }
.near-ridge { fill: rgba(55, 65, 81, .20); }
.tree-line { fill: rgba(55, 65, 81, .28); }
.water { fill: url(#waterWash); opacity: .88; }
.shoreline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  opacity: .74;
}
.sun-glow { fill: rgba(194, 106, 46, .18); }
.news-ticker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 248, 250, .9);
  overflow: hidden;
}
.news-ticker-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.news-ticker-window {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.news-ticker-track {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 34px;
  animation: ticker-scroll 38s linear infinite;
}
.news-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
}
.news-item strong {
  color: var(--brand);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.news-item::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .75;
  margin-left: 26px;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .news-ticker-track {
    width: auto;
    animation: none;
    overflow-x: auto;
  }
}

.status-card { padding: 24px; display: grid; align-content: center; gap: 10px; }
.status-card strong { font-size: 22px; }
.status-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.status-pill { width: fit-content; padding: 7px 11px; border-radius: 999px; background: #e8f5ef; color: var(--good); font-size: 12px; font-weight: 900; }
.weather-card { align-content: stretch; gap: 12px; }
.weather-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.weather-updated {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.weather-current {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}
.weather-temp {
  color: var(--ink);
  font-size: 44px;
  font-weight: 900;
  line-height: .9;
  letter-spacing: -0.05em;
}
.weather-current p {
  color: var(--ink);
  font-weight: 900;
  line-height: 1.2;
}
.weather-current span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
}
.weather-forecast {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.forecast-day {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  display: grid;
  gap: 2px;
}
.forecast-day span, .forecast-day small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.forecast-day strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
}

.portal-section { display: none; }
.active-section { display: block; }
.section-grid.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel { padding: 24px; min-height: 310px; }
.panel h2, .placeholder-panel h2, .section-title-row h2 { margin: 0; font-size: 28px; letter-spacing: -0.04em; }
.panel-header { margin-bottom: 18px; }

.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.check-list li {
  padding: 13px 14px 13px 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  position: relative;
  line-height: 1.35;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 15px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 4px #fff;
}

.timeline-list { display: grid; gap: 12px; }
.milestone {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}
.milestone-date { color: var(--accent); font-weight: 900; }
.milestone strong { display: block; margin-bottom: 3px; }
.milestone p { margin: 0; color: var(--muted); line-height: 1.4; }

.section-title-row { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 18px; }
.section-note { color: var(--muted); }
.camera-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.camera-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.camera-feed {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ced6df, #f6f7f8);
  color: #596574;
  font-weight: 900;
}
.camera-card div:last-child { padding: 16px; }
.camera-card h3 { margin: 0 0 6px; }
.camera-card p { margin: 0; color: var(--muted); line-height: 1.4; }

.placeholder-panel { padding: 34px; min-height: 320px; display: grid; align-content: center; }
.placeholder-panel p:last-child { max-width: 760px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.compact-section-header {
  padding: 12px 18px;
  min-height: 0;
}
.compact-section-header h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.compact-section-header .eyebrow {
  margin-bottom: 3px;
  font-size: 11px;
  line-height: 1;
}

.content-section { display: grid; gap: 18px; }
.media-grid, .contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.media-card { overflow: hidden; background: #fff; }
.media-preview {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #d9e0e7, #f8fafc);
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
}
.media-preview img, .camera-feed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-card-body, .contact-card { padding: 16px; }
.media-date {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.media-card h3, .contact-card h3 { margin: 0 0 7px; }
.media-card p, .contact-card p, .contact-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.timeline-section {
  width: 100%;
}
.timeline-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.timeline-image-link {
  display: block;
  width: 100%;
  background: #fff;
  text-decoration: none;
  overflow-x: auto;
}
.timeline-image-link img {
  width: 100%;
  height: auto;
  display: block;
}
.timeline-file-link {
  display: block;
  padding: 28px;
  background: var(--panel-soft);
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
}
.timeline-card-body {
  padding: 16px 18px;
}
.timeline-card h3 {
  margin: 0 0 7px;
}
.timeline-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.section-intro {
  max-width: 820px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}
.schemes-section { gap: 16px; }
.scheme-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.scheme-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  color: var(--brand);
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(18, 33, 52, 0.08);
}
.scheme-chip strong {
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  text-align: center;
}
.scheme-category {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.scheme-category-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 12px;
}
.scheme-category-heading h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}
.scheme-category-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.scheme-category-copy {
  max-width: 760px;
  margin: -3px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}
.scheme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.scheme-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(18, 33, 52, 0.09);
}
.scheme-preview {
  display: block;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #d9e0e7, #f8fafc);
}
.scheme-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scheme-card-body {
  min-height: 86px;
  padding: 12px;
}
.scheme-type {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.scheme-card h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}
.scheme-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.rendering-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.rendering-column {
  min-height: 360px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.rendering-column h3 {
  margin: 0 0 16px;
  font-size: 24px;
  letter-spacing: -0.03em;
}
.rendering-list { display: grid; gap: 18px; }
.empty-note {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--panel-soft);
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero, .section-grid.two-col, .camera-grid, .media-grid, .contact-grid, .rendering-columns { grid-template-columns: 1fr; }
  .scheme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .main-content, .sidebar { padding: 16px; }
  .nav-list { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
  .horizon-ribbon { height: 90px; }
  .scheme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scheme-category-heading { display: grid; gap: 4px; }
}
