/* =========================================================
   BREWLINE -- circuitry + coffee Neocities template
   Edit the CSS custom properties below to re-theme fast.
   ========================================================= */

:root {
  --bg:          #150d09;
  --bg-panel:    #1e140d;
  --bg-panel-2:  #251811;
  --copper:      #c17a3d;
  --copper-lite: #e3a463;
  --copper-dim:  #7a4f2c;
  --cream:       #f3e6d3;
  --cream-dim:   #cbb89f;
  --coffee:      #2b160b;
  --crema:       #d9a066;
  --teal:        #5eead4;
  --teal-dim:    #2e6f66;
  --radius:      10px;
  --font-mono:   'Space Mono', 'Courier New', monospace;
  --font-body:   'Work Sans', 'Segoe UI', sans-serif;
}

/* -------------------- reset -------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

/* Custom coffee-cup cursor. The two numbers are the hotspot
   (where the "tip" of the cursor actually clicks) -- tuned to
   sit near the top-left rim of the mug art. */
body {
  cursor: url("../assets/cursor-coffee.png") 6 4, auto;
  background:
    radial-gradient(ellipse at top left, rgba(193,122,61,0.10), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(94,234,212,0.06), transparent 60%),
    url("../assets/circuit-pattern.svg") repeat,
    var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a { color: var(--copper-lite); text-decoration: none; cursor: inherit; }
a:hover { color: var(--teal); text-decoration: underline; }
img { max-width: 100%; display: block; }

h1, h2, h3, .brand, nav a, .led-status {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* faint CRT-style scanlines over everything, purely decorative */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.06) 0px,
    rgba(0,0,0,0.06) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.35;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------- header -------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--copper-dim);
  flex-wrap: wrap;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  color: var(--cream);
}

.brand .mug { font-size: 1.4rem; }

.brand .blink-cursor {
  display: inline-block;
  width: 0.6em;
  background: var(--teal);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}

nav { display: flex; gap: 22px; flex-wrap: wrap; }
nav a {
  color: var(--cream-dim);
  font-size: 0.92rem;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
}
nav a:hover { color: var(--copper-lite); text-decoration: none; }
nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 0%; height: 1px;
  background: var(--teal);
  transition: width 0.25s ease;
}
nav a:hover::after { width: 100%; }

.led-status {
  font-size: 0.72rem;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.led-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px 1px var(--teal);
  animation: pulse 1.6s ease-in-out infinite;
}

/* -------------------- hero -------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 32px;
  padding: 64px 0 40px;
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; margin: 0 auto; }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 10px;
  color: var(--cream);
}
.hero h1 span { color: var(--copper-lite); }

.hero p.tagline {
  color: var(--cream-dim);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 0 24px;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid var(--copper);
  transition: all 0.2s ease;
}
.btn.primary {
  background: var(--copper);
  color: #1a1109;
}
.btn.primary:hover {
  background: var(--copper-lite);
  text-decoration: none;
  box-shadow: 0 0 16px rgba(193,122,61,0.55);
}
.btn.ghost { color: var(--cream); }
.btn.ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
  text-decoration: none;
  box-shadow: 0 0 16px rgba(94,234,212,0.3);
}

.hero-art { width: 100%; max-width: 320px; justify-self: center; }
.hero-art .trace {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  animation: dash 3.5s linear infinite;
  opacity: 0.8;
}
.hero-art .pad { fill: var(--copper-lite); }
.hero-art .led { fill: var(--teal); filter: drop-shadow(0 0 4px var(--teal)); animation: pulse 1.8s ease-in-out infinite; }
.hero-art .steam {
  stroke: var(--cream-dim);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  opacity: 0.7;
  animation: rise 3s ease-in-out infinite;
}
.hero-art .steam.s2 { animation-delay: 0.6s; }
.hero-art .steam.s3 { animation-delay: 1.2s; }
.hero-art .mugbody { fill: var(--cream); stroke: var(--copper-dim); stroke-width: 2; }
.hero-art .coffee { fill: var(--coffee); }
.hero-art .crema { fill: none; stroke: var(--crema); stroke-width: 2; }
.hero-art .handle { fill: none; stroke: var(--copper-dim); stroke-width: 6; }
.hero-art .chip { fill: #1a120c; stroke: var(--teal); stroke-width: 1.5; }
.hero-art .chip-leg { stroke: var(--teal); stroke-width: 1.5; }

/* -------------------- panels / about -------------------- */
.panel {
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--copper-dim);
  border-radius: var(--radius);
  padding: 28px;
  margin: 28px 0;
  position: relative;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 5px rgba(193,122,61,0.7);
}
.panel::before { top: -5px; left: -5px; }
.panel::after  { bottom: -5px; right: -5px; }

.panel h2 {
  color: var(--copper-lite);
  font-size: 1.3rem;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel h2::before {
  content: "//";
  color: var(--teal-dim);
}
.panel p { color: var(--cream-dim); }

/* -------------------- card grid -------------------- */
.section-title {
  font-family: var(--font-mono);
  color: var(--copper-lite);
  font-size: 1.3rem;
  margin: 44px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before { content: "//"; color: var(--teal-dim); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--copper-dim);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--teal-dim);
  box-shadow: 0 10px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(94,234,212,0.15);
}
.card .card-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
  text-transform: uppercase;
}
.card h3 { margin: 8px 0; color: var(--cream); font-size: 1.05rem; }
.card p { color: var(--cream-dim); font-size: 0.92rem; margin: 0 0 10px; }
.card a.read-more { font-family: var(--font-mono); font-size: 0.8rem; }

/* -------------------- neocities badge row -------------------- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0 4px;
}
.badge-88x31 {
  width: 88px; height: 31px;
  background: var(--bg-panel-2);
  border: 1px solid var(--copper-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--cream-dim);
  text-align: center;
  line-height: 1.1;
}

/* -------------------- footer -------------------- */
footer {
  border-top: 1px solid var(--copper-dim);
  padding: 26px 24px 60px;
  text-align: center;
  color: var(--cream-dim);
  font-size: 0.85rem;
}
footer .prompt {
  font-family: var(--font-mono);
  color: var(--teal);
  display: block;
  margin-bottom: 8px;
}

/* -------------------- keyframes -------------------- */
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes dash { to { stroke-dashoffset: -100; } }
@keyframes rise {
  0%   { transform: translateY(0);    opacity: 0; }
  20%  { opacity: 0.7; }
  100% { transform: translateY(-14px); opacity: 0; }
}

/* -------------------- coffee spill click effect --------------------
   Elements below are created at runtime by js/coffee-spill.js when the
   visitor clicks anywhere on the page. */
.coffee-spill {
  position: fixed;
  left: 0; top: 0;
  width: 0; height: 0;
  pointer-events: none;
  z-index: 1000;
}
.coffee-spill .drop {
  position: absolute;
  left: 0; top: 0;
  width: var(--d-size, 6px);
  height: var(--d-size, 6px);
  border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
  background: radial-gradient(circle at 35% 30%, var(--crema), var(--coffee) 70%);
  opacity: 0.95;
  animation: spill-fly var(--d-dur, 550ms) cubic-bezier(.25,.7,.4,1) forwards;
}
.coffee-spill .stain {
  position: absolute;
  left: 0; top: 0;
  width: var(--st-size, 14px);
  height: var(--st-size, 10px);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(43,22,11,0.55), rgba(43,22,11,0) 70%);
  transform: translate(-50%, -50%) scale(0.3);
  animation: spill-stain 700ms ease-out forwards;
}
@keyframes spill-fly {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.95; }
  100% { transform: translate(var(--d-x, 10px), var(--d-y, 24px)) scale(0.4); opacity: 0; }
}
@keyframes spill-stain {
  0%   { transform: translate(-50%, -50%) scale(0.2); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art .trace, .hero-art .led, .hero-art .steam,
  .led-status .dot, .brand .blink-cursor { animation: none !important; }
}
