@font-face {
  font-family: "Quadraat Kevzi";
  src: url("/assets/Qua3.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-raised: #0e1119;
  --panel: #11151e;
  --panel-strong: #151a24;
  --ink: #f1f2ed;
  --muted: #949baa;
  --quiet: #7f8796;
  --line: #29303d;
  --line-strong: #3b4555;
  --cyan: #7ee7ff;
  --cyan-dark: #143943;
  --coral: #ff6b4a;
  --amber: #f3c969;
  --green: #75e6a4;
  --display: "Quadraat Kevzi", Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  min-width: 320px;
  max-width: 100vw;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}
main, section, article, .workspace-heading, .workspace-heading > *, .workspace-intro {
  min-width: 0;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
::selection { background: var(--cyan); color: #041015; }

.shell { width: var(--shell); margin-inline: auto; }
.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 231, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 231, 255, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}
.ambient-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 12%, rgba(126, 231, 255, .09), transparent 28%),
    radial-gradient(circle at 91% 25%, rgba(255, 107, 74, .065), transparent 25%);
}

.skip-link {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 200;
  transform: translateY(-180%);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 800;
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(59, 69, 85, .72);
  background: rgba(8, 10, 15, .88);
  backdrop-filter: blur(18px);
}
.header-inner {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}
.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--cyan);
  color: #071015;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1;
  box-shadow: 5px 5px 0 var(--cyan-dark);
}
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-size: 12px; letter-spacing: .18em; }
.brand-copy small { margin-top: 6px; color: var(--muted); font: 9px/1 var(--mono); letter-spacing: .13em; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 10px 14px;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .18s ease, border-color .18s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); border-color: var(--cyan); }
.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}
.dashboard-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  text-decoration: none;
  font: 800 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease;
}
.dashboard-link:hover, .dashboard-link:focus-visible { background: var(--cyan); color: #071015; }
.local-clock {
  color: var(--cyan);
  font: 700 13px/1 var(--mono);
  letter-spacing: .08em;
}

.workspace { padding-block: 72px 90px; }
.workspace-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .72fr);
  align-items: end;
  gap: clamp(40px, 8vw, 112px);
  padding-bottom: 48px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--muted);
  font: 700 11px/1.2 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow span {
  width: 9px;
  height: 9px;
  background: var(--coral);
  box-shadow: 0 0 18px rgba(255, 107, 74, .6);
}
h1, h2 { margin: 0; }
h1 {
  max-width: 700px;
  font-family: var(--display);
  font-size: clamp(72px, 9.5vw, 132px);
  font-weight: 400;
  line-height: .76;
  letter-spacing: -.052em;
}
h1 em { color: var(--cyan); font-style: normal; }
.workspace-intro > p {
  margin: 0;
  color: #c0c4cd;
  font-size: clamp(16px, 1.55vw, 20px);
  line-height: 1.65;
}
.workspace-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 30px 0 0;
  border-block: 1px solid var(--line);
}
.workspace-facts div { padding: 13px 8px 13px 0; }
.workspace-facts dt { color: var(--quiet); font: 10px/1.2 var(--mono); text-transform: uppercase; }
.workspace-facts dd { margin: 7px 0 0; color: var(--ink); font: 700 13px/1.2 var(--mono); }

.widget-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.widget {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(20, 25, 35, .98), rgba(12, 15, 22, .98));
  overflow: hidden;
  box-shadow: 0 22px 80px rgba(0, 0, 0, .22);
}
.widget::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 76px;
  background: var(--cyan);
}
.widget-market { grid-column: span 8; min-height: 510px; }
.widget-password { grid-column: span 4; }
.widget-color, .widget-dice { grid-column: span 6; }
.widget-color::before { background: var(--coral); }
.widget-dice::before { background: var(--amber); }
.widget-header {
  min-height: 85px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.widget-index { color: var(--quiet); font: 10px/1 var(--mono); letter-spacing: .1em; }
.widget h2 { margin-top: 8px; font-size: 20px; letter-spacing: -.02em; }
.local-badge {
  padding: 6px 8px;
  border: 1px solid rgba(117, 230, 164, .35);
  color: var(--green);
  font: 700 9px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.market-tabs { display: flex; gap: 4px; }
.market-tabs button, .text-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 800 11px/1 var(--mono);
  letter-spacing: .07em;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.market-tabs button { min-width: 48px; min-height: 44px; padding: 9px 10px; }
.market-tabs button:hover, .market-tabs button[aria-selected="true"] {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #071015;
}
.market-frame { position: relative; height: 368px; background: #080b12; }
.market-frame iframe { position: relative; z-index: 1; width: 100%; height: 100%; border: 0; display: block; opacity: 0; transition: opacity .25s ease; }
.market-frame.is-loaded iframe { opacity: 1; }
.market-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--quiet);
  font: 11px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.market-loading span { width: 38px; height: 2px; background: var(--cyan); animation: scan 1.1s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateX(-18px); opacity: .3; } to { transform: translateX(18px); opacity: 1; } }
.market-frame.is-loaded .market-loading { display: none; }
.widget-footer {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font: 10px/1.4 var(--mono);
}
.widget-footer a { color: var(--cyan); text-decoration: none; }
.widget-footer a:hover { text-decoration: underline; }

.widget-password { padding-bottom: 20px; }
.password-output {
  min-height: 94px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 20px 20px 10px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  background: #090c12;
}
.password-output output {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font: 700 15px/1.45 var(--mono);
}
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: var(--cyan);
  cursor: pointer;
}
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.strength { height: 3px; margin: 0 20px; background: var(--line); }
.strength span { display: block; width: 0; height: 100%; background: var(--coral); transition: width .25s ease, background .25s ease; }
.strength-label { margin: 7px 20px 19px; color: var(--quiet); font: 10px/1.3 var(--mono); }
.control-group { margin: 0 20px 18px; }
.range-row label { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.range-row strong { color: var(--ink); font-family: var(--mono); }
input[type="range"] { width: 100%; accent-color: var(--cyan); }
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 20px 18px;
  padding: 0;
  border: 0;
}
.check-grid legend { margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  color: #c3c8d1;
  cursor: pointer;
  font: 700 11px/1 var(--mono);
}
.check-grid input { accent-color: var(--cyan); }
.action-button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--cyan);
  background: var(--cyan);
  color: #061015;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 900;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.widget-password > .action-button { width: calc(100% - 40px); margin-inline: 20px; }
.action-button:hover { background: transparent; color: var(--cyan); }
.action-button:active { transform: translateY(1px); }

.text-button { min-height: 44px; padding: 9px 11px; }
.text-button:hover { border-color: var(--coral); color: var(--ink); }
.text-button:disabled { opacity: .4; cursor: not-allowed; }
.color-stage {
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  background: #7ee7ff;
  color: #061015;
  transition: background .2s ease, color .2s ease;
}
.color-stage input[type="color"] {
  width: 52px;
  height: 36px;
  padding: 0;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}
.color-hex-large { font: 400 clamp(42px, 6vw, 80px)/.85 var(--display); letter-spacing: -.03em; }
.contrast-label { font: 700 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.color-values { display: grid; grid-template-columns: repeat(3, 1fr); }
.color-values button {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.color-values button:last-child { border-right: 0; }
.color-values button:hover { background: rgba(126, 231, 255, .06); }
.color-values span { color: var(--quiet); font: 9px/1 var(--mono); letter-spacing: .1em; }
.color-values strong { overflow: hidden; color: var(--ink); font: 700 12px/1.3 var(--mono); text-overflow: ellipsis; white-space: nowrap; }

.dice-stage {
  min-height: 230px;
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 26px;
  padding: 22px 26px;
}
.dice-glyph {
  width: 148px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  background: var(--amber);
  color: #17130a;
  clip-path: polygon(50% 0, 96% 26%, 83% 82%, 50% 100%, 17% 82%, 4% 26%);
  filter: drop-shadow(0 18px 28px rgba(243, 201, 105, .12));
}
.dice-glyph::before {
  content: "";
  position: absolute;
  width: 112px;
  aspect-ratio: 1;
  border: 1px solid rgba(23, 19, 10, .32);
  clip-path: inherit;
}
.dice-glyph span { position: relative; z-index: 1; font: 400 52px/1 var(--display); }
.dice-glyph.is-rolling { animation: dice-roll .48s cubic-bezier(.2,.8,.2,1); }
@keyframes dice-roll { 50% { transform: rotate(13deg) scale(.86); filter: brightness(1.35); } }
.dice-summary { display: grid; gap: 7px; }
.dice-summary span { color: var(--amber); font: 700 11px/1 var(--mono); letter-spacing: .1em; }
.dice-summary strong { font-family: var(--display); font-size: 46px; font-weight: 400; line-height: 1; }
.dice-summary small { color: var(--quiet); font-size: 12px; }
.dice-controls {
  display: grid;
  grid-template-columns: .7fr .7fr 1fr;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}
.dice-controls label { display: grid; gap: 6px; color: var(--quiet); font: 9px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.dice-controls select {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #090c12;
  color: var(--ink);
  padding: 0 11px;
}
.dice-controls .action-button { align-self: end; }

.links-section {
  border-block: 1px solid var(--line);
  background: #0b0e14;
}
.links-layout {
  display: grid;
  grid-template-columns: minmax(260px, .55fr) minmax(0, 1.45fr);
  gap: clamp(50px, 9vw, 130px);
  padding-block: 88px;
}
.links-layout header { align-self: start; position: sticky; top: 110px; }
.links-layout h2 { font-family: var(--display); font-size: clamp(55px, 7vw, 92px); font-weight: 400; line-height: .85; letter-spacing: -.04em; }
.links-layout header > p:last-child { max-width: 360px; margin: 24px 0 0; color: var(--muted); line-height: 1.7; }
.link-list { border-top: 1px solid var(--line); }
.link-list a {
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(120px, .7fr) 30px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .16s ease, padding .16s ease;
}
.link-list a:hover { padding-inline: 12px; background: rgba(126, 231, 255, .045); }
.link-list span { color: var(--quiet); font: 10px/1 var(--mono); }
.link-list strong { font-size: 18px; }
.link-list small { color: var(--muted); }
.link-list i { justify-self: end; color: var(--cyan); font-style: normal; }

.site-footer { background: #06070a; }
.footer-inner {
  min-height: 128px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  color: var(--quiet);
  font: 10px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.footer-inner strong { color: var(--ink); letter-spacing: .16em; }
.footer-inner a { justify-self: end; color: var(--cyan); text-decoration: none; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 15px;
  border: 1px solid var(--cyan);
  background: #0b1117;
  color: var(--ink);
  box-shadow: 0 18px 60px rgba(0,0,0,.42);
  font: 700 11px/1.4 var(--mono);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 980px) {
  .workspace-heading { grid-template-columns: 1fr; gap: 34px; }
  .workspace-intro { max-width: 680px; }
  .widget-market, .widget-password { grid-column: 1 / -1; }
  .widget-color, .widget-dice { grid-column: span 6; }
  .links-layout { grid-template-columns: 1fr; gap: 44px; }
  .links-layout header { position: static; }
}

@media (max-width: 720px) {
  :root { --shell: min(calc(100% - 28px), 1180px); }
  html { scroll-padding-top: 78px; }
  .header-inner { min-height: 64px; grid-template-columns: 1fr auto; gap: 10px; }
  .site-nav { display: none; }
  .header-actions { gap: 10px; }
  .local-clock { display: none; }
  .dashboard-link { min-height: 36px; padding-inline: 11px; font-size: 10px; }
  .brand-mark { width: 34px; height: 34px; box-shadow: 3px 3px 0 var(--cyan-dark); }
  .workspace { padding-block: 50px 64px; }
  .workspace-heading { width: 100%; padding-bottom: 34px; }
  .workspace-intro { width: 100%; max-width: 100%; }
  .workspace-intro > p { max-width: 100%; overflow-wrap: anywhere; }
  h1 { max-width: 100%; font-size: clamp(66px, 22vw, 100px); }
  .workspace-facts { width: 100%; grid-template-columns: 1fr; }
  .workspace-facts div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); }
  .workspace-facts div:last-child { border-bottom: 0; }
  .workspace-facts dd { margin: 0; }
  .widget-grid { width: 100%; grid-template-columns: minmax(0, 1fr); }
  .widget-market, .widget-password, .widget-color, .widget-dice { grid-column: 1; width: 100%; }
  .widget-header { align-items: flex-start; flex-wrap: wrap; padding: 16px; }
  .widget-market .widget-header { display: grid; grid-template-columns: 1fr; }
  .market-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .market-tabs button { width: 100%; min-width: 0; padding-inline: 7px; }
  .market-frame { height: 320px; }
  .widget-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .password-output, .strength, .strength-label, .control-group { margin-inline: 16px; }
  .check-grid { margin-inline: 16px; }
  .widget-password > .action-button { width: calc(100% - 32px); margin-inline: 16px; }
  .color-stage { min-height: 210px; }
  .color-values { grid-template-columns: 1fr; }
  .color-values button { grid-template-columns: 44px minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--line); }
  .color-values button:last-child { border-bottom: 0; }
  .dice-stage { grid-template-columns: 130px 1fr; gap: 15px; padding-inline: 15px; }
  .dice-glyph { width: 116px; }
  .dice-glyph::before { width: 88px; }
  .dice-glyph span { font-size: 42px; }
  .dice-summary strong { font-size: 36px; }
  .dice-controls { grid-template-columns: 1fr 1fr; }
  .dice-controls .action-button { grid-column: 1 / -1; }
  .links-layout { padding-block: 66px; }
  .link-list a { grid-template-columns: 34px minmax(0, 1fr) 26px; }
  .link-list small { display: none; }
  .footer-inner { min-height: 150px; grid-template-columns: 1fr; align-content: center; gap: 12px; }
  .footer-inner a { justify-self: start; }
}

@media (max-width: 430px) {
  .brand-copy small { display: none; }
  .market-tabs { gap: 2px; }
  .market-tabs button { min-width: 39px; font-size: 10px; }
  .check-grid { grid-template-columns: 1fr; }
  .dice-stage { grid-template-columns: 1fr; text-align: center; }
  .dice-summary { justify-items: center; }
}

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