/* ----------------------------------------------------------------------------
   pshpshv :: testing polygon
   plain static styles. no framework, no build step. i don't know webpack.
---------------------------------------------------------------------------- */

:root {
  --bg: #0a0d12;
  --bg-elev: #0e131b;
  --surface: #141b26;
  --surface-2: #19212e;
  --border: #222c3b;
  --border-soft: #1a2330;
  --text: #e7edf4;
  --text-strong: #f4f8fc;
  --muted: #8c9aad;
  --faint: #5a6678;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --accent-grad: linear-gradient(120deg, #5eead4, #60a5fa);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 760px;
  --shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.65);
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #e1e7ef;
  --border-soft: #eceff4;
  --text: #1a2230;
  --text-strong: #0b1017;
  --muted: #586575;
  --faint: #94a1b2;
  --accent: #0d9488;
  --accent-2: #2563eb;
  --accent-grad: linear-gradient(120deg, #0d9488, #2563eb);
  --shadow: 0 18px 50px -26px rgba(20, 30, 50, 0.22);
}

/* --- base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

h1, h2, h3 { color: var(--text-strong); line-height: 1.2; margin: 0; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); }
.muted { color: var(--muted); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.skip-link:focus { left: 12px; }

/* --- background canvas (the borrowed codepen thing) ----------------------- */
.field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.5; pointer-events: none; }

body::before {
  content: "";
  position: fixed;
  top: -28vh; left: 50%;
  transform: translateX(-50%);
  width: 90vw; height: 65vh;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%);
  filter: blur(40px);
  z-index: 0; pointer-events: none;
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

/* --- header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { display: inline-flex; align-items: baseline; font-family: var(--font-mono); color: var(--text-strong); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-prompt { color: var(--accent); }
.brand-text { font-size: 1rem; }

.nav { display: flex; align-items: center; gap: 20px; }
.nav a { color: var(--muted); font-size: 0.9rem; font-family: var(--font-mono); }
.nav a:hover { color: var(--text-strong); text-decoration: none; }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: border-color 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* --- terminal window (hero) ----------------------------------------------- */
.hero { padding: clamp(48px, 9vw, 96px) 22px 18px; }

.term {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 15px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.tl { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.tl.r { background: #ff5f57; } .tl.y { background: #febc2e; } .tl.g { background: #28c840; }
.term-title { margin-left: 8px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.term-body { padding: clamp(20px, 4vw, 30px); font-family: var(--font-mono); }

.cmd { margin: 0 0 4px; color: var(--muted); font-size: 0.9rem; }
.prompt { color: var(--accent); margin-right: 8px; }

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1.45rem, 4.6vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 6px 0 22px;
  line-height: 1.3;
}
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.6s ease-in-out infinite; }
@keyframes wave { 0%,60%,100%{transform:rotate(0)} 10%,30%{transform:rotate(14deg)} 20%{transform:rotate(-8deg)} }

.hero-lead {
  font-family: var(--font-sans);
  color: var(--text);
  font-size: 1.02rem;
  margin: 6px 0 22px;
  max-width: 62ch;
}
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--faint);
  margin: 16px 2px 0;
}

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.9rem;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent-grad); color: #06121a; font-weight: 650; }
.btn-mini { font-size: 0.8rem; padding: 7px 15px; background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-mini:hover { border-color: var(--accent); transform: translateY(-1px); }

/* --- sections ------------------------------------------------------------- */
.section { padding: clamp(34px, 6vw, 58px) 22px; }
.sec-title {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3.4vw, 1.55rem);
  font-weight: 650;
  margin-bottom: 22px;
}
.sec-title .slash { color: var(--accent); margin-right: 8px; }

/* --- experiment boxes ----------------------------------------------------- */
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

.box {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 11px;
}
.box h3 { font-family: var(--font-mono); font-size: 1.02rem; color: var(--accent); }
.box .muted { font-size: 0.88rem; margin: 0; }

/* color generator */
.forge-swatch {
  height: 84px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: linear-gradient(120deg, #5eead4, #60a5fa);
  cursor: pointer; transition: background 0.5s ease;
}
.forge-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.forge-code {
  font-size: 0.7rem; color: var(--muted); background: var(--surface-2);
  padding: 6px 9px; border-radius: 7px; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* echo + guestbook inputs */
.echo-input {
  width: 100%; font-family: var(--font-mono); font-size: 0.92rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px; transition: border-color 0.2s ease;
}
.echo-input:focus { outline: none; border-color: var(--accent); }
.echo-input::placeholder { color: var(--faint); }
.echo-out {
  font-family: var(--font-mono); font-size: 1.1rem; letter-spacing: 0.16em; font-weight: 600;
  min-height: 1.6em; word-break: break-word;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* clock */
.pulse { display: flex; align-items: baseline; gap: 12px; }
.clock { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 650; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.clock-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.pulse-bar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 2px; }
.pulse-bar span { display: block; height: 100%; width: 40%; border-radius: 999px; background: var(--accent-grad); animation: slide 2.8s ease-in-out infinite; }
@keyframes slide { 0%{transform:translateX(-110%)} 100%{transform:translateX(360%)} }

/* --- about / prose -------------------------------------------------------- */
.prose { max-width: 66ch; }
.prose p { color: var(--muted); margin: 0 0 16px; }

.facts {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: flex; flex-wrap: wrap; gap: 22px;
  font-family: var(--font-mono); font-size: 0.86rem; color: var(--muted);
}
.facts b { color: var(--text-strong); font-size: 1.4rem; font-weight: 700; display: block; }

/* --- todo ----------------------------------------------------------------- */
.todo { list-style: none; padding: 0; margin: 0; font-family: var(--font-mono); }
.todo li { padding: 5px 0; color: var(--muted); }
.todo li::before { content: "[ ] "; color: var(--faint); white-space: pre; }
.todo li.done { color: var(--text); text-decoration: line-through; text-decoration-color: var(--faint); }
.todo li.done::before { content: "[x] "; color: var(--accent); }
.todo .note { color: var(--faint); font-style: italic; text-decoration: none; }

/* --- guestbook ------------------------------------------------------------ */
.guestbook { display: flex; gap: 10px; flex-wrap: wrap; max-width: 480px; }
.guestbook .echo-input { flex: 1; min-width: 180px; }
.gb-msg { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); margin: 14px 0 0; min-height: 1.4em; }

/* --- footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border-soft); margin-top: 30px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 22px; padding-bottom: 30px; }
.footer-note { font-size: 0.82rem; color: var(--faint); margin: 0; font-family: var(--font-mono); }
.to-top { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }
.to-top:hover { color: var(--text-strong); text-decoration: none; }

/* --- 404 ------------------------------------------------------------------ */
.error-wrap { min-height: 78vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 40px 22px; }
.error-code { font-family: var(--font-mono); font-size: clamp(4rem, 18vw, 8rem); font-weight: 800; line-height: 1; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-wrap h1 { font-family: var(--font-mono); }
.error-wrap p { color: var(--muted); max-width: 46ch; margin: 0; }

/* --- motion / a11y -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .field { display: none; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 520px) {
  .nav { gap: 12px; }
  .nav a { display: none; }
  .facts { gap: 16px; }
}
