/* HYALEC.DEV — design system (sem build step; tokens em :root) */
:root {
  --bg: #07090d; --bg-2: #0b0f16; --surface: #10151e; --surface-2: #151b26;
  --line: #1e2633; --line-2: #2a3446;
  --text: #f2f5fa; --muted: #98a2b3; --faint: #667085;
  --accent: #3b82f6; --accent-2: #60a5fa; --accent-glow: rgba(59, 130, 246, .28);
  --ok: #34d399; --warn: #fbbf24; --danger: #f87171;
  --radius: 14px; --radius-sm: 9px; --max: 1160px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mono { font-family: var(--mono); }
section { padding: clamp(56px, 9vw, 104px) 0; position: relative; }
.eyebrow { font: 600 .78rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 18px; display: inline-block; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: rgba(7, 9, 13, .78); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { font: 800 1.15rem var(--mono); letter-spacing: .12em; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #1d4ed8); box-shadow: 0 0 18px var(--accent-glow); display: inline-block; }
.brand small { color: var(--faint); font-weight: 500; letter-spacing: .04em; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 9px; padding: 8px 12px; font: inherit; cursor: pointer; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav-links { position: absolute; top: 66px; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 16px 18px; display: none; }
  .nav-links.open { display: flex; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 11px; font: 600 .95rem var(--font); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .15s, border-color .15s, background .15s, box-shadow .15s; min-height: 44px; }
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: linear-gradient(180deg, #4b8dff, var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 6px 24px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 8px 32px rgba(59, 130, 246, .45); border-color: transparent; }
.btn-danger { border-color: rgba(248, 113, 113, .4); color: var(--danger); }
.btn-sm { padding: 7px 13px; min-height: 36px; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { padding: clamp(72px, 12vw, 150px) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(60% 55% at 78% 8%, rgba(59, 130, 246, .20), transparent 70%),
  radial-gradient(40% 40% at 8% 90%, rgba(59, 130, 246, .08), transparent 70%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; opacity: .22; mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent); -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { background: linear-gradient(180deg, #fff 30%, #a9b8d0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin-bottom: 32px; }
.terminal { background: rgba(16, 21, 30, .85); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 60px var(--accent-glow); overflow: hidden; }
.terminal-bar { display: flex; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.terminal pre { margin: 0; padding: 22px; font: .88rem/1.8 var(--mono); color: #c9d4e6; overflow-x: auto; }
.tk { color: #7aa7ff; } .ts { color: #7ee0b5; } .tc { color: var(--faint); }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } }

/* cards */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
.card-media { aspect-ratio: 16 / 9; background: radial-gradient(80% 90% at 30% 20%, rgba(59, 130, 246, .22), var(--surface-2)); display: grid; place-items: center; color: var(--faint); font: 700 2rem var(--mono); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { color: var(--muted); font-size: .95rem; margin: 0; }
.card-foot { margin-top: auto; padding-top: 10px; }
.card h3 a { color: var(--text); }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: .76rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); background: var(--bg-2); }
.badge { font: 600 .72rem var(--mono); letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: rgba(59, 130, 246, .12); color: var(--accent-2); border: 1px solid rgba(59, 130, 246, .3); display: inline-block; }
.badge.idea { background: rgba(152, 162, 179, .1); color: var(--muted); border-color: var(--line-2); }
.badge.production, .badge.beta { background: rgba(52, 211, 153, .1); color: var(--ok); border-color: rgba(52, 211, 153, .3); }
.badge.draft, .badge.private { background: rgba(251, 191, 36, .1); color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* tech */
.tech-group { margin-bottom: 30px; }
.tech-group h3 { font: 600 .8rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tech { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .2s; }
.tech:hover { border-color: var(--accent); }
.tech-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(59, 130, 246, .12); color: var(--accent-2); font: 700 .8rem var(--mono); flex: none; overflow: hidden; }
.tech-icon img { width: 100%; height: 100%; object-fit: contain; }
.tech span { font-size: .9rem; font-weight: 500; }

/* about */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.pillars { display: grid; gap: 14px; }
.pillar { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pillar b { display: block; margin-bottom: 4px; }
.pillar span { color: var(--muted); font-size: .92rem; }
.prose { color: #cdd5e2; max-width: 74ch; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 16px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: .2em 1em; color: var(--muted); }

/* detail pages */
.page-hero { padding: clamp(48px, 8vw, 90px) 0 24px; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.page-hero .sub { color: var(--muted); font-size: 1.15rem; max-width: 720px; }
.crumbs { font-size: .85rem; color: var(--faint); margin-bottom: 18px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.side { position: sticky; top: 90px; display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { font: 600 .78rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { padding-left: 28px; position: relative; color: #cdd5e2; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .5em; width: 14px; height: 14px; border-radius: 50%; background: rgba(59, 130, 246, .18); border: 1px solid var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 24px 0; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.gallery figcaption { padding: 10px 14px; font-size: .85rem; color: var(--muted); }
.cover { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 8px 0 36px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.video { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin: 24px 0; }
.video iframe { width: 100%; height: 100%; border: 0; }
.preview-banner { background: rgba(251, 191, 36, .1); border-bottom: 1px solid rgba(251, 191, 36, .35); color: var(--warn); text-align: center; padding: 8px; font-size: .88rem; }
.notice { border: 1px dashed var(--line-2); border-radius: 12px; padding: 16px 18px; color: var(--muted); font-size: .92rem; background: var(--bg-2); }

/* plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.plan.hl { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 20px 60px var(--accent-glow); }
.plan .price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.plan .price small { font-size: .85rem; font-weight: 500; color: var(--muted); }
details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; color: var(--accent-2); font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--muted); margin: 12px 0 0; }

/* filters */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 10px; margin-bottom: 32px; align-items: end; }
@media (max-width: 960px) { .filters { grid-template-columns: 1fr 1fr; } .filters .grow { grid-column: 1 / -1; } }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 40px; align-items: center; color: var(--muted); }
.empty { text-align: center; padding: 64px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }

/* forms */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], select, textarea, input[type=file] {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); padding: 11px 13px; border-radius: 10px; font: inherit; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: 1fr 1fr; } @media (max-width: 720px) { .form-grid.two { grid-template-columns: 1fr; } }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--danger); font-size: .85rem; }
.helptext { display: block; color: var(--faint); font-size: .8rem; margin-top: 5px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line-2); margin-bottom: 16px; background: var(--surface); }
.flash.success { border-color: rgba(52, 211, 153, .4); color: var(--ok); } .flash.error { border-color: rgba(248, 113, 113, .4); color: var(--danger); }
.auth-card { max-width: 420px; margin: 8vh auto; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; background: var(--bg-2); }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-grid a { color: var(--muted); display: block; padding: 3px 0; }
.copy { color: var(--faint); font-size: .85rem; margin-top: 32px; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* dashboard */
.dash { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.dash-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dash-side a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--muted); margin-bottom: 2px; font-size: .93rem; }
.dash-side a:hover, .dash-side a.active { background: var(--surface); color: var(--text); text-decoration: none; }
.dash-side h4 { font: 600 .7rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 22px 12px 8px; }
.dash-main { padding: 32px clamp(16px, 3vw, 40px) 80px; min-width: 0; }
.dash-main h1 { font-size: 1.8rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 24px 0 36px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat b { font-size: 2.1rem; display: block; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--faint); font: 600 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; } .actions form { display: inline; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 24px 0; background: var(--surface); }
.fieldset legend { padding: 0 8px; color: var(--muted); font-weight: 600; }
.formset-row { border: 1px dashed var(--line-2); border-radius: 12px; padding: 16px; margin-bottom: 14px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
ul.check-list, .field-checks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
ul.check-list label, .field-checks label { display: inline-flex; gap: 8px; align-items: center; color: var(--text); margin: 0; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } .dash-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; } .dash-side h4 { width: 100%; margin-top: 8px; } }
