:root {
  color-scheme: dark;
  --sea: #0c1c20;
  --surface: #13282e;
  --border: #31494d;
  --gold: #e8c279;
  --ink: #f1f3ea;
  --muted: #b0c4c3;
  --display: Georgia, "Times New Roman", serif;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--sea);
  color: var(--ink);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.65; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }

.shell { width: min(1180px, calc(100% - 96px)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 12px; background: var(--sea); transform: translateY(-180%); }
.skip:focus { transform: none; }
.masthead { border-bottom: 1px solid var(--border); }
.masthead-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.masthead-inner { min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: bold 1.55rem var(--display); color: var(--gold); }
.brand img { object-fit: contain; }
nav { display: flex; align-items: center; gap: clamp(16px, 4vw, 46px); }
nav a { color: var(--muted); font-size: .9375rem; }
nav a:hover { color: var(--gold); }

.outline, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.1rem;
  font-size: .9375rem;
  font-weight: 650;
  border: 1px solid #84714f;
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}
.outline:hover { background: #e8c27913; border-color: var(--gold); }
.gold { background: var(--gold); color: var(--sea); border-color: var(--gold); }
.gold:hover { background: #f5d89d; }

.hero {
  display: grid;
  align-items: center;
  min-height: clamp(490px, 49vw, 680px);
  border-bottom: 1px solid #786343;
  background:
    linear-gradient(90deg, #08181cf5 4%, #0a1c21d9 28%, #0a1c2166 52%, transparent 77%),
    linear-gradient(0deg, #07171c85, transparent 40%),
    url("media/porto.webp") 65% center / cover no-repeat,
    var(--surface);
}
.hero-inner { padding-block: 56px; }
.eyebrow { color: var(--gold); font-size: .875rem; text-transform: uppercase; letter-spacing: .17em; font-weight: 700; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; }
h1 { font-size: clamp(4rem, 8.6vw, 8rem); letter-spacing: -.075em; line-height: .91; margin-block: 17px 24px; }
h1 span { color: var(--gold); }
.hero-copy { color: #d2e1df; max-width: 365px; font-size: clamp(1rem, 1.65vw, 1.2rem); }
.hero .button { margin-top: 28px; min-height: 48px; }

h2 { font-size: clamp(2.1rem, 4.4vw, 4rem); line-height: 1.06; letter-spacing: -.05em; }
h3 { font-size: clamp(1.38rem, 2.4vw, 2.25rem); line-height: 1.12; letter-spacing: -.025em; }
.gallery { padding-block: 75px 83px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px 30px; margin-bottom: 26px; }
.section-heading p, .demo-info > p:last-child, .resource-grid p, .server-grid p { color: var(--muted); }
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 23px;
}
.demo-controls a { padding: 12px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-size: .9375rem; font-weight: 650; }
.demo-controls a:hover, .demo-controls a[aria-selected="true"] { color: var(--gold); }
.demo-controls a[aria-selected="true"] { border-bottom-color: var(--gold); background: #e8c2790b; }
.demo {
  display: grid;
  grid-template-columns: minmax(205px, 1fr) minmax(0, 2.85fr);
  align-items: center;
  gap: clamp(20px, 4vw, 52px);
  padding: clamp(18px, 3.2vw, 42px);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: radial-gradient(ellipse at top right, #213b3b, transparent 65%), var(--surface);
}
.demo:not([hidden]) + .demo:not([hidden]) { margin-top: 18px; }
.demo-info h3 { margin-block: 14px 11px; }
.capture { position: relative; display: block; background: var(--sea); border: 1px solid #5e6250; border-radius: 5px; overflow: hidden; }
.capture img { width: 100%; height: auto; aspect-ratio: 1170 / 780; object-fit: contain; }
.capture:hover { border-color: var(--gold); }
.zoom { position: absolute; right: 10px; bottom: 10px; padding: 6px 12px; border: 1px solid #796747; background: #0c1c20; color: var(--gold); border-radius: 4px; font-size: .875rem; font-weight: 650; }
.zoom b { margin-left: 5px; }

.band { background: #10252b; border-block: 1px solid var(--border); }
.resources, .servers { padding-block: 65px; }
.resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 30px; }
.resource-grid article { border-top: 1px solid #8b7148; padding-top: 18px; }
.resource-grid h3 { font-size: 1.5rem; }
.resource-grid p, .server-grid p { margin-top: 8px; }
code { color: var(--gold); }
.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 25px; }
.server-grid article { padding: 21px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
footer { border-top: 1px solid var(--border); }
.footer-inner { min-height: 80px; }
.footer-inner small { font-size: .875rem; color: var(--muted); }

.print-dialog {
  padding: 12px;
  max-width: min(1280px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  background: var(--sea);
  color: var(--ink);
  border: 1px solid #84714f;
  border-radius: 6px;
}
.print-dialog::backdrop { background: #030c0de8; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.dialog-top h2 { font: 650 1rem "Segoe UI", system-ui, sans-serif; letter-spacing: 0; }
.print-dialog img { max-height: 82vh; object-fit: contain; margin-inline: auto; }

@media (max-width: 820px) {
  .shell { width: calc(100% - 48px); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 540px) {
  .shell { width: calc(100% - 32px); }
  .masthead-inner { min-height: 62px; gap: 12px; }
  .masthead-action { display: none; }
  .hero {
    min-height: 520px;
    background:
      linear-gradient(90deg, #08181cdd, #08181c60),
      linear-gradient(0deg, #08181caf, transparent 72%),
      url("media/porto.webp") 61% center / cover no-repeat,
      var(--surface);
  }
  .gallery, .resources, .servers { padding-block: 48px; }
  .demo-controls a { padding: 10px 5px; }
  .resource-grid { gap: 20px; }
  .server-grid { grid-template-columns: minmax(0, 1fr); }
  .zoom { right: 4px; bottom: 4px; padding: 3px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
}
