:root {
  color-scheme: light;
  --ink: #111113;
  --muted: #727274;
  --line: #e6e8ed;
  --accent: #f97316;
  --soft: #f5f8fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #ffffff;
  line-height: 1.55;
}

a {
  color: var(--ink);
}

a:hover {
  color: #b45309;
}

.container {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  animation: page-load-fade 420ms ease-out both;
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  color: var(--ink);
  font-family: "Space Grotesk", "Avenir Next", Arial, sans-serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  color: var(--ink);
}

.header-app {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 0.85rem;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.header-app:hover,
.header-app:focus-visible {
  border-color: #ea580c;
  background: #ea580c;
  color: var(--ink);
  outline: none;
}

.header-app-icon {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site-menu {
  position: relative;
  flex: 0 0 auto;
}

.site-menu summary {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.16);
  cursor: pointer;
  list-style: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.site-menu summary::-webkit-details-marker {
  display: none;
}

.site-menu summary:hover,
.site-menu summary:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.22);
  transform: translateY(-1px);
}

.site-menu img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-menu:not([open]) .menu-panel {
  display: none;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  display: grid;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
}

.menu-panel a {
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.menu-panel a:hover,
.menu-panel a:focus-visible {
  background: #fff7ed;
  color: #9a3412;
  outline: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.hero {
  animation: page-load-rise 520ms ease-out 80ms both;
  padding-bottom: 18px;
}

.hero h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.45rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
}

.hero-copy {
  max-width: 54ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  gap: 0.55rem;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
}

.btn-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.btn-primary {
  background: var(--ink);
  color: #ffffff;
}

.btn-primary:hover {
  color: #ffffff;
  background: #2c2d31;
}

.btn-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.btn-secondary:hover {
  background: var(--soft);
}

.app-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  animation: page-load-rise 560ms ease-out 160ms both;
}

@keyframes page-load-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes page-load-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-topbar {
  display: flex;
  gap: 7px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.preview-topbar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d7dbe3;
}

.preview-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 10px;
}

.preview-title p,
.preview-title strong {
  margin: 0;
}

.preview-title p {
  color: var(--muted);
  font-weight: 800;
}

.preview-title strong {
  color: var(--accent);
  font-size: clamp(1.4rem, 4vw, 2.25rem);
}

.preview-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  height: 220px;
  margin: 12px 22px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  border: 1px solid #fed7aa;
  padding: 22px;
}

.preview-chart span {
  min-height: 24px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #f97316 0%, #fbbf24 100%);
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.preview-metrics div {
  padding: 16px 18px;
}

.preview-metrics div + div {
  border-left: 1px solid var(--line);
}

.preview-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-metrics strong {
  display: block;
  margin-top: 3px;
}

.features {
  padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 10vw, 120px);
}

.features-intro {
  max-width: 660px;
  margin-bottom: clamp(40px, 7vw, 78px);
}

.features-intro h2 {
  margin: 0;
  font-size: clamp(2rem, 4.7vw, 3.7rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.features-intro p {
  max-width: 60ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
}

.feature-showcase {
  display: grid;
  gap: clamp(46px, 7vw, 88px);
}

.feature {
  display: grid;
  align-items: center;
  gap: clamp(26px, 5vw, 66px);
}

.feature-copy {
  max-width: 330px;
}

.feature-number {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.94rem;
  font-weight: 700;
}

.feature-copy h3 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", Arial, sans-serif;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.feature-copy p {
  margin: 14px 0 0;
  color: #555961;
}

.feature-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.09);
}

.feature-forecast {
  grid-template-columns: minmax(0, 1.55fr) minmax(235px, 0.65fr);
}

.feature-battery {
  grid-template-columns: minmax(220px, 0.48fr) minmax(0, 0.9fr);
  max-width: 870px;
}

.feature-assistant {
  grid-template-columns: minmax(220px, 0.5fr) minmax(0, 0.78fr);
  max-width: 860px;
  margin-left: auto;
}

.feature-panel-head,
.assistant-panel-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.feature-panel-head > div:first-child {
  display: grid;
  gap: 1px;
}

.feature-panel-head strong,
.assistant-panel-head strong {
  color: #202126;
  font-size: 0.9rem;
  line-height: 1.2;
}

.feature-panel-head span,
.wind-detail > span,
.soc-stat span {
  color: var(--muted);
  font-size: 0.73rem;
}

.weather-summary {
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-summary svg {
  width: 23px;
  height: 23px;
  fill: #fff7ed;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.forecast-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
  padding: 14px;
}

.generation-plot,
.wind-detail {
  min-width: 0;
}

.plot-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 7px;
  color: #555961;
  font-size: 0.67rem;
}

.plot-key span::before {
  display: inline-block;
  width: 16px;
  height: 2px;
  margin-right: 5px;
  vertical-align: middle;
  background: currentColor;
  content: "";
}

.plot-key-solar { color: var(--accent); }
.plot-key-load { color: #9aa5b5; }
.plot-key-load::before,
.plot-key-reserve::before { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; }
.plot-key-soc { color: #2563eb; }
.plot-key-reserve { color: #9aa5b5; }

.generation-plot > svg {
  display: block;
  width: 100%;
  height: 188px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
}

.plot-grid path {
  fill: none;
  stroke: #e8edf3;
  stroke-width: 1;
}

.plot-load {
  fill: none;
  stroke: #9aa5b5;
  stroke-dasharray: 4 5;
  stroke-width: 2;
}

.plot-solar-fill {
  fill: rgba(249, 115, 22, 0.08);
}

.plot-solar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.plot-axis,
.wind-detail > div {
  display: flex;
  justify-content: space-between;
  color: #747983;
  font-size: 0.62rem;
}

.plot-axis { margin-top: 4px; }

.wind-detail {
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  padding: 12px;
}

.wind-detail strong { font-size: 0.78rem; }

.wind-detail svg {
  width: 100%;
  height: 82px;
  margin-top: 4px;
  border-bottom: 1px solid #e8edf3;
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.5;
}

.time-range {
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 8px;
  color: #3d424b !important;
  font-size: 0.68rem !important;
}

.battery-panel-body {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
}

.soc-stat {
  display: grid;
  align-content: start;
  gap: 2px;
  border-right: 1px solid var(--line);
}

.soc-stat strong {
  color: #23252a;
  font-size: 1.45rem;
  line-height: 1;
}

.battery-plot > svg {
  display: block;
  width: 100%;
  height: 174px;
}

.critical-zone { fill: rgba(248, 113, 113, 0.1); }

.reserve-line {
  fill: none;
  stroke: #9aa5b5;
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.soc-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 3;
}

.soc-point {
  fill: #ffffff;
  stroke: #dc2626;
  stroke-width: 3;
}

.battery-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  color: #dc2626;
  font-size: 0.75rem;
}

.battery-panel-footer strong {
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 7px 9px;
  color: #b45309;
  font-size: 0.72rem;
}

.assistant-panel-head {
  justify-content: flex-start;
  min-height: 52px;
}

.assistant-spark {
  color: var(--accent);
  font-size: 1.15rem;
}

.assistant-preview {
  padding-bottom: 12px;
}

.assistant-question,
.assistant-answer {
  max-width: 78%;
  margin: 14px 14px 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.76rem;
  line-height: 1.42;
}

.assistant-question {
  margin-left: auto;
  background: #eaf2ff;
  color: #1e3a5f;
}

.assistant-answer {
  background: #f4f5f6;
  color: #33363d;
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 14px;
}

.assistant-actions span {
  border: 1px solid #e3e7ec;
  border-radius: 6px;
  padding: 6px 8px;
  color: #424752;
  font-size: 0.68rem;
}

.assistant-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 14px;
  border: 1px solid #e3e7ec;
  border-radius: 7px;
  padding: 8px 9px;
  color: #8a909b;
  font-size: 0.7rem;
}

.assistant-input span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 1rem;
}

h2,
main h1 {
  font-family: "Space Grotesk", "Avenir Next", Arial, sans-serif;
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(18px, 3vw, 30px);
  background: #ffffff;
}

.guide-page {
  max-width: 920px;
}

.guide-intro {
  margin: 0 auto 28px;
  max-width: 680px;
  text-align: center;
}

.guide-label {
  display: inline-flex;
  margin: 0 0 10px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff7ed;
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-intro h1 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
}

.guide-intro > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.guide-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 28px;
}

.guide-index a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: #555961;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.guide-index a:hover,
.guide-index a:focus-visible {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  outline: none;
}

.guide-sections {
  display: grid;
  gap: 16px;
}

.guide-card {
  scroll-margin-top: 90px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 32px);
  background: #ffffff;
}

.guide-card h2 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", Arial, sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
}

.guide-card h3 {
  margin: 24px 0 0;
  color: #33363d;
  font-size: 1rem;
}

.guide-card h3 + p,
.guide-card h3 + ul {
  margin-top: 8px;
}

.guide-card p,
.guide-card li {
  color: #555961;
}

.guide-card ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.guide-card li + li {
  margin-top: 8px;
}

.guide-card li::marker {
  color: var(--accent);
}

.guide-summary {
  margin: 6px 0 0;
  color: var(--muted) !important;
}

p {
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

.warning {
  margin-top: 24px;
  padding: 12px 14px;
  border-left: 4px solid #f0bd4f;
  background: #fff8e8;
  color: #6f4f02;
  border-radius: 10px;
}

.site-footer {
  padding: 10px 0 26px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .site-header .container {
    align-items: center;
  }

  .menu-panel {
    min-width: min(230px, calc(100vw - 32px));
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .app-preview {
    border-radius: 22px;
  }

  .preview-metrics {
    grid-template-columns: 1fr;
  }

  .preview-metrics div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .feature-forecast,
  .feature-battery,
  .feature-assistant {
    grid-template-columns: 1fr;
    max-width: none;
    margin-left: 0;
  }

  .feature-copy {
    max-width: 600px;
  }

  .feature-battery .feature-copy,
  .feature-assistant .feature-copy {
    order: -1;
  }
}

@media (max-width: 560px) {
  .features {
    padding-top: 58px;
  }

  .forecast-panel-body {
    grid-template-columns: 1fr;
  }

  .generation-plot > svg {
    height: 154px;
  }

  .wind-detail svg {
    height: 54px;
  }

  .battery-panel-body {
    grid-template-columns: 1fr;
  }

  .soc-stat {
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: start;
    gap: 8px;
    border-right: 0;
  }

  .battery-plot > svg {
    height: 150px;
  }

  .battery-panel-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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