/* TechLink Vault — one-time secrets. Design DNA copied from src/tokens.css */
:root {
  --bg: #06070b;
  --bg-elev: #0b0d14;
  --ink: #e9ebf2;
  --ink-dim: #9aa1b5;
  --ink-faint: #848da6;
  --line: rgba(233, 235, 242, 0.08);

  --robotics: #3ee0ff;
  --ai: #9d7bff;
  --energy: #ffb43a;

  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --space-unit: clamp(16px, 2.2vw, 28px);
  --radius: 2px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--robotics);
  color: var(--bg);
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(233, 235, 242, 0.13) 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 74%, rgba(233, 235, 242, 0.09) 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 14%, rgba(233, 235, 242, 0.11) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 79% 52%, rgba(62, 224, 255, 0.14) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 86%, rgba(233, 235, 242, 0.1) 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 48%, rgba(157, 123, 255, 0.12) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 51% 91%, rgba(233, 235, 242, 0.08) 50%, transparent 51%),
    var(--bg);
  background-size: 520px 520px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.04;
  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");
}

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

/* ---------- Header ---------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(var(--space-unit) * 0.9) var(--space-unit);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.node {
  display: inline-block;
  width: 0.32em;
  height: 0.32em;
  margin-left: 0.12em;
  background: var(--robotics);
  transform: translateY(-0.55em);
  border-radius: 1px;
  box-shadow: 0 0 10px rgba(62, 224, 255, 0.8);
}

.head-tag {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--space-unit) * 2) var(--space-unit) calc(var(--space-unit) * 3);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--robotics);
}

.kicker::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--robotics);
  flex: none;
}

h1 {
  margin-top: calc(var(--space-unit) * 0.7);
  font-weight: 700;
  font-size: clamp(30px, 5.4vw, 46px);
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.lede {
  margin-top: calc(var(--space-unit) * 0.6);
  max-width: 54ch;
  color: var(--ink-dim);
  font-size: 15.5px;
}

.lede strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  margin-top: calc(var(--space-unit) * 1.4);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: calc(var(--space-unit) * 1.1);
}

.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--robotics), rgba(62, 224, 255, 0));
}

.card--ai::before {
  background: linear-gradient(90deg, var(--ai), rgba(157, 123, 255, 0));
}

.card--energy::before {
  background: linear-gradient(90deg, var(--energy), rgba(255, 180, 58, 0));
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.char-count {
  letter-spacing: 0.04em;
  text-transform: none;
}

.char-count.is-over {
  color: var(--energy);
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13.5px;
  line-height: 1.6;
}

textarea::placeholder {
  color: var(--ink-faint);
}

.lede--flush {
  margin-top: 0;
}

a.btn {
  text-decoration: none;
}

/* TTL segmented control */
.ttl-field .field-label {
  margin-bottom: 8px;
}

.ttl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: calc(var(--space-unit) * 0.9);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  padding: 9px 15px;
  cursor: pointer;
  border-left: 1px solid var(--line);
  user-select: none;
}

.segmented label:first-of-type {
  border-left: 0;
}

.segmented input:checked + label {
  background: rgba(62, 224, 255, 0.09);
  color: var(--robotics);
}

.segmented input:focus-visible + label {
  outline: 2px solid var(--robotics);
  outline-offset: -2px;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--robotics);
  border-radius: var(--radius);
  background: rgba(62, 224, 255, 0.08);
  color: var(--robotics);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: rgba(62, 224, 255, 0.16);
  box-shadow: 0 0 18px rgba(62, 224, 255, 0.18);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-dim);
}

.btn--ghost:hover {
  background: rgba(233, 235, 242, 0.05);
  box-shadow: none;
}

.btn--danger {
  border-color: var(--energy);
  background: rgba(255, 180, 58, 0.08);
  color: var(--energy);
}

.btn--danger:hover {
  background: rgba(255, 180, 58, 0.16);
  box-shadow: 0 0 18px rgba(255, 180, 58, 0.15);
}

/* ---------- Result / secret output ---------- */
.link-box,
.secret-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  word-break: break-all;
  white-space: pre-wrap;
  overflow-x: auto;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: calc(var(--space-unit) * 0.8);
  align-items: center;
}

.note {
  margin-top: calc(var(--space-unit) * 0.8);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.note--warn {
  color: var(--energy);
}

.note--ok {
  color: var(--robotics);
}

.error-msg {
  color: var(--energy);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

/* ---------- Facts strip ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: calc(var(--space-unit) * 1.4);
  overflow: hidden;
}

.fact {
  background: var(--bg-elev);
  padding: 16px 18px;
}

.fact dt {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.fact dd {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-dim);
}

/* ---------- Footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: calc(var(--space-unit) * 0.9) var(--space-unit);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.site-foot a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

.site-foot a:hover {
  color: var(--robotics);
  border-bottom-color: var(--robotics);
}

.foot-links {
  display: flex;
  gap: 22px;
}

@media (max-width: 560px) {
  .facts {
    grid-template-columns: 1fr;
  }

  .head-tag {
    display: none;
  }

  .segmented label {
    padding: 9px 11px;
  }
}
