/* Widgets for OPNsense: project site.
   Look: a network operations console. Slate panels, a fine rack grid, signal orange from the logo. */

:root {
  --bg: #0e1113;
  --bg-2: #14181b;
  --panel: #1a1f23;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #e8ecef;
  --text-2: #a4aeb7;
  --text-3: #6c7782;
  --orange: #e8590c;
  --orange-2: #ff7a2e;
  --slate: #5c6670;
  --slate-2: #8a949e;
  --green: #2dd4a0;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Figtree", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Film grain over everything, very faint */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
img { display: block; }
::selection { background: var(--orange); color: #fff; }

section, .foot { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font: 600 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--orange-2); margin-bottom: 18px;
}
.eyebrow::before { content: "// "; color: var(--text-3); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: 0.005em; line-height: 0.95; }
h2 { font-size: clamp(40px, 6vw, 68px); text-transform: uppercase; margin-bottom: 22px; }
h3 { font-size: 30px; text-transform: uppercase; margin-bottom: 12px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  background: rgba(14, 17, 19, 0.78); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 21px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.brand em { font-style: normal; color: var(--text-3); font-weight: 600; }
.nav nav { display: flex; gap: 26px; font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.nav nav a { text-decoration: none; color: var(--text-2); transition: color 0.2s; }
.nav nav a:hover { color: var(--text); }
.nav .nav-gh { color: var(--orange-2); }
@media (max-width: 760px) { .nav nav a:not(.nav-gh) { display: none; } }

/* Hero */
.hero {
  position: relative; min-height: 78vh;
  display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 40px;
  padding-top: 72px; padding-bottom: 150px;
}
.hero-grid {
  position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at 72% 42%, rgba(232, 89, 12, 0.16), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
h1 { font-size: clamp(56px, 9.5vw, 128px); text-transform: uppercase; font-weight: 900; margin-bottom: 28px; }
h1 .hl { color: var(--orange); }
.lede { max-width: 560px; color: var(--text-2); font-size: 19px; margin-bottom: 34px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px;
  font: 600 15px/1 var(--body); text-decoration: none; border-radius: 4px;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 0 0 1px var(--orange), 0 10px 30px -10px rgba(232, 89, 12, 0.7); }
.btn-primary:hover { background: var(--orange-2); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--text-2); color: var(--text); transform: translateY(-2px); }
.meta { font: 400 13px/1 var(--mono); color: var(--text-3); }
.meta i { font-style: normal; color: var(--orange); padding: 0 6px; }

/* Keycaps: Win then W press in a loop */
.keys { display: grid; grid-template-columns: auto auto auto; align-items: center; justify-content: center; gap: 18px; }
.key {
  display: grid; place-items: center; width: 132px; height: 132px; border-radius: 18px;
  font: 800 64px/1 var(--display); color: var(--text);
  background: linear-gradient(180deg, #2a3137, #1b2024);
  border: 1px solid var(--line-2);
  box-shadow: 0 10px 0 #0a0c0e, 0 12px 0 1px rgba(255,255,255,0.06), 0 30px 50px -10px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: press 4s infinite;
}
.key svg { width: 50px; height: 50px; color: var(--slate-2); }
.key-w { animation-delay: 0.35s; }
.plus { font: 600 34px/1 var(--mono); color: var(--text-3); }
.keys-cap { grid-column: 1 / -1; text-align: center; margin-top: 22px; font: 400 13px/1 var(--mono); color: var(--text-3); letter-spacing: 0.06em; }
@keyframes press {
  0%, 12%, 100% { transform: translateY(0); box-shadow: 0 10px 0 #0a0c0e, 0 12px 0 1px rgba(255,255,255,0.06), 0 30px 50px -10px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1); }
  5%, 9% { transform: translateY(8px); border-color: rgba(232, 89, 12, 0.8);
           box-shadow: 0 2px 0 #0a0c0e, 0 0 40px -4px rgba(232, 89, 12, 0.55), inset 0 1px 0 rgba(255,255,255,0.1); }
}

/* Demo board */
.demo { position: relative; margin-top: -90px; padding-bottom: 130px; }
.demo-head { display: flex; justify-content: space-between; align-items: end; gap: 28px; flex-wrap: wrap; margin-bottom: 30px; }
.demo-head h2 { font-size: clamp(34px, 4.6vw, 52px); max-width: 640px; }
.sub { color: var(--text-2); max-width: 580px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-2); }
.seg button {
  font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 14px; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--orange); color: #fff; }
.seg button:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }

.board {
  --board-bg: #202020; --tile-bg: #2b2b2b; --tile-text: #fff; --tile-text-2: rgba(255,255,255,0.72);
  display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 14px;
  padding: 34px 24px; border-radius: 14px;
  background: var(--board-bg);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.9), 0 0 0 1px rgba(0,0,0,0.5);
  transition: background 0.35s;
  position: relative;
}
.board::before { /* corner marks, like a rack panel */
  content: ""; position: absolute; inset: 10px; pointer-events: none; border-radius: 8px;
  background:
    linear-gradient(var(--orange), var(--orange)) top left / 14px 2px no-repeat,
    linear-gradient(var(--orange), var(--orange)) top left / 2px 14px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom right / 2px 14px no-repeat;
}
.board[data-theme="light"] { --board-bg: #e9eef3; --tile-bg: #fbfbfb; --tile-text: #1a1a1a; --tile-text-2: rgba(0,0,0,0.6); }
.tile {
  position: relative; width: 302px; height: var(--h, 464px); flex: none;
  border-radius: 8px; overflow: hidden; background: var(--tile-bg); color: var(--tile-text);
  transition: height 0.45s cubic-bezier(.2,.8,.2,1), background 0.35s;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}
.board[data-size="small"] .tile { --h: 148px; }
.board[data-size="medium"] .tile { --h: 306px; }
.tile iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.titlebar {
  position: absolute; top: 0; left: 0; right: 0; height: 44px; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 16px;
  pointer-events: none; font-size: 14px;
}
.titlebar .name { display: flex; align-items: center; gap: 10px; }
.titlebar img { width: 16px; height: 16px; }
.titlebar .more { font-size: 16px; font-weight: 700; letter-spacing: 1px; color: var(--tile-text-2); }

/* Widgets list */
.widgets { padding-bottom: 130px; }
.wlist { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); margin-top: 40px; }
.w { padding: 34px 30px 10px 0; position: relative; }
.w + .w { padding-left: 30px; border-left: 1px solid var(--line); }
.num { display: block; font: 900 84px/1 var(--display); color: transparent; -webkit-text-stroke: 1px var(--slate); margin-bottom: 18px; }
.w:hover .num { -webkit-text-stroke-color: var(--orange); }
.w p { color: var(--text-2); font-size: 16px; margin-bottom: 22px; }
.sizes { display: grid; gap: 8px; }
.sizes div { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: baseline; }
.sizes dt { font: 600 12px/22px var(--mono); text-align: center; border: 1px solid var(--line-2); border-radius: 3px; color: var(--orange-2); }
.sizes dd { font-size: 14px; color: var(--text-3); }

/* Platforms */
.platforms { padding-bottom: 130px; }
.plist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.p { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; transition: border-color 0.25s, transform 0.25s; }
.p:hover { border-color: rgba(232, 89, 12, 0.5); transform: translateY(-4px); }
.p h3 { font-size: 26px; margin-top: 22px; }
.p p { color: var(--text-2); font-size: 15px; }
.mock { height: 170px; border-radius: 6px; position: relative; overflow: hidden; border: 1px solid var(--line); }

.mock-win { background: radial-gradient(circle at 30% 20%, #2c4a6a, #14202d 70%); }
.mw-board { position: absolute; left: 14px; top: 14px; bottom: 34px; width: 58%; padding: 8px; border-radius: 6px;
  background: rgba(30, 30, 30, 0.75); backdrop-filter: blur(6px); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
.mw-board span { height: 40px; border-radius: 4px; background: #2b2b2b; border-top: 3px solid var(--slate); }
.mw-board span.tall { height: 86px; grid-row: span 2; border-top-color: var(--orange); }
.mw-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 24px; background: rgba(20, 20, 20, 0.85); display: flex; justify-content: center; gap: 8px; align-items: center; }
.mw-bar i { width: 12px; height: 12px; border-radius: 3px; background: var(--slate); }
.mw-bar i.on { background: var(--orange); box-shadow: 0 0 10px var(--orange); }

.mock-kde { background: linear-gradient(160deg, #1d2b3a, #0f1720); }
.mk-widget { position: absolute; right: 16px; top: 16px; width: 44%; height: 98px; border-radius: 6px; background: rgba(42, 46, 50, 0.92); padding: 10px; display: grid; gap: 7px; align-content: start; }
.mk-widget b { height: 18px; border-radius: 3px; background: #3a4046; border-left: 3px solid var(--green); }
.mk-widget b:nth-child(2) { border-left-color: #5ba3ff; }
.mk-widget.small { right: auto; left: 16px; width: 34%; height: 60px; }
.mk-widget.small u { display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(transparent 55%, rgba(45, 212, 160, 0.25) 55%), repeating-linear-gradient(90deg, transparent 0 10px, rgba(45,212,160,0.5) 10px 11px); }
.mk-panel { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: rgba(30, 33, 36, 0.95); display: flex; gap: 10px; align-items: center; padding-left: 12px; }
.mk-panel i { width: 14px; height: 14px; border-radius: 50%; background: var(--slate); }
.mk-panel i.on { border-radius: 3px; background: var(--orange); margin-left: auto; margin-right: 12px; }

.mock-gnome { background: linear-gradient(180deg, #2a2a2e, #1b1b1e); }
.mg-bar { height: 26px; background: #000; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 10px; font: 600 11px/1 var(--body); color: #ddd; }
.mg-bar span:nth-child(2) { text-align: center; }
.mg-btn { justify-self: end; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 10px; background: rgba(255,255,255,0.14); }
.mg-btn img { width: 11px; height: 11px; }
.mg-btn i { width: 6px; height: 6px; border-radius: 50%; background: #5ba3ff; }
.mg-menu { position: absolute; right: 10px; top: 32px; width: 64%; padding: 8px; border-radius: 10px; background: #353539; box-shadow: 0 8px 24px rgba(0,0,0,0.5); display: grid; gap: 5px; }
.mg-menu p { display: flex; justify-content: space-between; font: 500 11px/1.4 var(--body); color: #eee; padding: 4px 6px; border-radius: 5px; background: rgba(255,255,255,0.05); }
.mg-menu p span { font-family: var(--mono); color: #8ab4f8; font-size: 10px; }
.mg-menu p.t span { color: var(--green); }

/* Privacy */
.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding-bottom: 130px; }
.privacy-copy p:not(.eyebrow) { color: var(--text-2); margin-bottom: 20px; }
.link { color: var(--orange-2); font: 600 14px/1 var(--mono); text-decoration: none; border-bottom: 1px solid rgba(232, 89, 12, 0.5); padding-bottom: 3px; }
.link:hover { color: #fff; border-color: #fff; }
.flow { display: grid; grid-template-columns: 1fr; gap: 0; position: relative; padding: 30px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg-2); }
.node { padding: 18px 20px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); display: grid; gap: 6px; }
.node-k { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.node-v { font: 800 26px/1 var(--display); text-transform: uppercase; }
.node-fw { border-color: rgba(232, 89, 12, 0.6); }
.node-fw .node-v { color: var(--orange-2); }
.wire { position: relative; height: 92px; margin-left: 40px; border-left: 2px solid var(--slate); }
.wire span { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font: 400 12px/1.4 var(--mono); color: var(--text-2); }
.wire i { position: absolute; left: -5px; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px var(--orange); animation: packet 1.8s linear infinite; }
@keyframes packet { from { top: 0; } to { top: calc(100% - 8px); } }
.nocloud { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.nocloud s { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); padding: 7px 10px; border: 1px solid var(--line); border-radius: 3px; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }

/* Setup */
.setup { padding-bottom: 130px; }
.steps { list-style: none; counter-reset: s; display: grid; gap: 0; margin-top: 40px; border-top: 1px solid var(--line-2); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 120px 1fr; column-gap: 30px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); grid-row: 1 / span 10; font: 900 64px/0.9 var(--display); color: var(--orange); }
.steps h3 { font-size: 30px; }
.steps p { color: var(--text-2); max-width: 720px; margin-bottom: 12px; }
.steps b { color: var(--text); font-weight: 600; }
.steps p a { color: var(--orange-2); }
.path { font: 400 0.88em var(--mono); color: var(--text); background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.note { font-size: 14px; color: var(--text-3) !important; }
.note a { color: var(--text-2); }
.priv { border-collapse: collapse; margin: 6px 0 14px; font-size: 14px; max-width: 720px; width: 100%; }
.priv th { text-align: left; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); padding: 0 16px 10px 0; border-bottom: 1px solid var(--line-2); }
.priv td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.priv td:first-child { color: var(--text); white-space: nowrap; }
pre { max-width: 720px; overflow-x: auto; padding: 16px 18px; border-radius: 6px; background: #080a0b; border: 1px solid var(--line); border-left: 3px solid var(--orange); }
code { font: 400 13.5px/1.7 var(--mono); color: #cfd8df; }

/* Footer */
.foot { padding-top: 40px; padding-bottom: 60px; border-top: 1px solid var(--line); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; font: 500 13px/1 var(--mono); }
.foot nav a { color: var(--text-2); text-decoration: none; }
.foot nav a:hover { color: var(--orange-2); }
.legal { font-size: 13px; color: var(--text-3); max-width: 760px; }
.legal a { color: var(--text-2); }

/* Motion: staggered load, reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); animation: rise 0.8s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--d) * 110ms + 100ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.reveal-on-scroll { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s cubic-bezier(.2,.8,.2,1); }
.reveal-on-scroll.in { opacity: 1; transform: none; }
.plist .p:nth-child(2), .wlist .w:nth-child(2) { transition-delay: 0.1s; }
.plist .p:nth-child(3), .wlist .w:nth-child(3) { transition-delay: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal-on-scroll { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 130px; }
  .keys { justify-content: start; }
  .key { width: 96px; height: 96px; font-size: 46px; }
  .key svg { width: 36px; height: 36px; }
  .keys-cap { text-align: left; }
  .wlist, .plist { grid-template-columns: 1fr; }
  .w + .w { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .privacy { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .board { padding: 24px 8px; }
  .steps li { grid-template-columns: 1fr; }
  .steps li::before { grid-row: auto; margin-bottom: 14px; font-size: 48px; }
  .priv td:first-child { white-space: normal; }
}
