/* ── sfas.dev · phosphor observability aesthetic ─────────────── */

:root {
  --bg: #080d0c;
  --bg-raised: #0c1312;
  --bg-card: #0a1110;
  --line: #1a2a26;
  --line-bright: #244339;
  --ink: #d7e6df;
  --ink-dim: #5f7a70;
  --accent: #33ffbb;
  --accent-soft: rgba(51, 255, 187, 0.08);
  --accent-glow: rgba(51, 255, 187, 0.35);
  --amber: #ffc266;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "Fraunces", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(51, 255, 187, 0.055), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  background-attachment: fixed;
}

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

a { color: inherit; }

.dim { color: var(--ink-dim); }
.ok { color: var(--accent); }

/* grain + scanline atmosphere */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 999; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-2%); }
  80% { transform: translate(3%,3%); }
}
.scanline {
  position: fixed; inset: 0; pointer-events: none; z-index: 998; opacity: .04;
  background: repeating-linear-gradient(0deg, transparent 0 2px, #000 2px 4px);
}

/* ── status bar ── */
.statusbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
}
.statusbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 24px;
}
.logo {
  font-weight: 700; text-decoration: none; font-size: 15px;
  letter-spacing: .02em;
}
.logo:hover .dim { color: var(--accent); transition: color .2s; }
.status-pill {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .12em;
  border: 1px solid var(--line-bright); border-radius: 99px;
  padding: 4px 12px; color: var(--accent);
  background: var(--accent-soft);
}
.status-pill .sep { letter-spacing: 0; }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.topnav { margin-left: auto; display: flex; gap: 20px; font-size: 13px; }
.topnav a { text-decoration: none; color: var(--ink-dim); transition: color .2s; }
.topnav a:hover { color: var(--accent); }
.topnav a::before { content: "./"; opacity: .5; }
.nav-cta { color: var(--accent) !important; }

main { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── hero ── */
.hero { padding: 160px 0 60px; position: relative; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.meta-chip {
  font-size: 11.5px; letter-spacing: .06em;
  border: 1px solid var(--line); border-radius: 4px;
  padding: 4px 10px; color: var(--ink);
  background: var(--bg-raised);
}
.hero-title {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(46px, 8.5vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 20ch;
}
.hero-title > span { display: block; }
.serif-i { font-style: italic; font-weight: 340; color: var(--accent); }
.accent-num {
  font-style: normal;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .92em;
  color: var(--accent);
  text-shadow: 0 0 32px var(--accent-glow);
  letter-spacing: -.04em;
}

.hero-spark { width: 100%; height: 90px; margin: 36px 0 8px; overflow: visible; }
.spark-path {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--accent-glow));
  stroke-dasharray: 2600; stroke-dashoffset: 2600;
  animation: draw 2.8s cubic-bezier(.4,0,.2,1) .6s forwards;
}
.spark-head {
  fill: var(--accent); opacity: 0;
  filter: drop-shadow(0 0 8px var(--accent));
  animation: fadein .4s 3.2s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

.hero-sub { max-width: 62ch; margin-top: 28px; }
.hero-sub p { font-size: 15.5px; color: var(--ink-dim); }
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-sub code {
  color: var(--amber); font-size: .9em;
  background: var(--bg-raised); padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--line);
}

.hero-uptime {
  margin-top: 40px; display: flex; align-items: baseline; gap: 14px;
  font-size: 13.5px; flex-wrap: wrap;
}
.uptime-value { color: var(--accent); font-weight: 600; letter-spacing: .03em; }
.cursor {
  display: inline-block; width: 9px; height: 18px;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── sections ── */
section { padding: 72px 0; border-top: 1px solid var(--line); }
.hero { border-top: none; }

.section-label {
  font-size: 12.5px; letter-spacing: .1em; text-transform: lowercase;
  color: var(--accent); margin-bottom: 28px;
}
.section-title {
  font-family: var(--serif); font-weight: 380;
  font-size: clamp(30px, 4.5vw, 52px);
  letter-spacing: -.01em; margin-bottom: 44px; line-height: 1.1;
}

/* ── metrics ── */
.metric-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
}
.metric {
  background: var(--bg-card); padding: 26px 24px 20px;
  position: relative; transition: background .25s;
}
.metric:hover { background: var(--bg-raised); }
.metric:hover .mspark path { stroke: var(--accent); }
.metric-value {
  font-size: 34px; font-weight: 700; letter-spacing: -.03em;
  color: var(--ink);
}
.metric-value span { color: var(--accent); }
.metric-label { font-size: 12.5px; color: var(--ink-dim); margin-top: 6px; min-height: 2.6em; }
.mspark { width: 100%; height: 24px; margin-top: 12px; }
.mspark path {
  fill: none; stroke: var(--line-bright); stroke-width: 1.5;
  transition: stroke .3s;
}

/* ── systems ── */
.system-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.system {
  background: var(--bg-card); padding: 34px 32px;
  transition: background .25s;
  position: relative;
}
.system:hover { background: var(--bg-raised); }
.system:hover .sys-index { color: var(--accent); }
.system-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.sys-index { font-size: 12px; color: var(--ink-dim); letter-spacing: .1em; transition: color .25s; }
.system h3 {
  font-family: var(--serif); font-size: 30px; font-weight: 450;
  letter-spacing: -.01em;
}
.sys-badge {
  margin-left: auto; font-size: 11px; letter-spacing: .08em;
  color: var(--accent); border: 1px solid var(--line-bright);
  padding: 3px 10px; border-radius: 99px; background: var(--accent-soft);
}
.sys-tag { color: var(--amber); font-size: 13px; margin: 8px 0 16px; }
.system ul { list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 76ch; }
.system li { padding-left: 22px; position: relative; color: var(--ink-dim); font-size: 14px; }
.system li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.system li em { color: var(--ink); font-style: italic; }
.sys-stack { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.sys-stack span {
  font-size: 11px; letter-spacing: .05em; color: var(--ink-dim);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: 3px;
}

/* ── worklog ── */
.log-entries { display: flex; flex-direction: column; }
.log-entry {
  display: grid; grid-template-columns: 190px 1fr; gap: 32px;
  padding: 32px 0; border-bottom: 1px dashed var(--line);
}
.log-entry:last-child { border-bottom: none; }
.log-time .ts {
  font-size: 12.5px; color: var(--accent); letter-spacing: .05em;
  position: sticky; top: 80px;
}
.log-body h3 { font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.log-body h3 .dim { font-weight: 400; }
.log-context { color: var(--amber); font-size: 13px; margin: 6px 0 14px; }
.log-body ul { list-style: none; display: flex; flex-direction: column; gap: 8px; max-width: 72ch; }
.log-body li { padding-left: 20px; position: relative; color: var(--ink-dim); font-size: 14px; }
.log-body li::before { content: ">"; position: absolute; left: 0; color: var(--accent); }

/* ── stack ── */
.stack-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.stack-col h4 {
  font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.stack-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.stack-col li { font-size: 13.5px; color: var(--ink-dim); }
.stack-col:last-child li { font-style: italic; color: var(--ink); font-size: 13px; }

/* ── contact ── */
.contact { text-align: left; }
.contact-title {
  font-family: var(--serif); font-weight: 380;
  font-size: clamp(28px, 4.2vw, 48px); line-height: 1.15;
  margin-bottom: 40px; max-width: 24ch;
}
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; }
.contact-btn {
  text-decoration: none; font-size: 13.5px;
  border: 1px solid var(--line-bright); border-radius: 4px;
  padding: 12px 20px; color: var(--ink);
  transition: all .2s; background: var(--bg-raised);
}
.contact-btn:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 24px rgba(51, 255, 187, .12);
  transform: translateY(-2px);
}
.contact-btn.primary {
  background: var(--accent); color: var(--bg); font-weight: 600;
  border-color: var(--accent);
}
.contact-btn.primary:hover {
  color: var(--bg);
  box-shadow: 0 0 32px var(--accent-glow);
}
.contact-note { margin-top: 24px; font-size: 12.5px; }

/* ── footer ── */
.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 24px;
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; flex-wrap: wrap;
}

/* ── reveal animation ── */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1);
}
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .05s; }
.d2 { transition-delay: .15s; }
.d3 { transition-delay: .25s; }
.d4 { transition-delay: .4s; }
.d5 { transition-delay: .55s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .spark-path { stroke-dashoffset: 0; }
  .spark-head { opacity: 1; }
}

/* ── responsive ── */
@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .stack-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .topnav a:not(.nav-cta) { display: none; }
  .status-pill .sep, .status-pill #clock { display: none; }
  .hero { padding-top: 120px; }
  .metric-grid { grid-template-columns: 1fr; }
  .log-entry { grid-template-columns: 1fr; gap: 8px; }
  .log-time .ts { position: static; }
  .stack-cols { grid-template-columns: 1fr; }
  .system { padding: 26px 20px; }
  .sys-badge { margin-left: 0; }
}
