/* meklab.net — laboratory terminal aesthetic, shared with the in-cluster dashboard. */
:root {
  --bg:          #08090b;
  --bg-subtle:   #0d0e12;
  --surface:     #12141a;
  --surface-hi:  #181b23;
  --border:      #1e2230;
  --border-hi:   #2a2f3d;
  --text:        #d8dae0;
  --text-bright: #eceef2;
  --muted:       #7d839a;
  --dim:         #4e5470;
  --accent:      #4ecdc4;
  --accent-dim:  #3ba89f;
  --accent-glow: rgba(78, 205, 196, 0.15);
  --accent-flare:rgba(78, 205, 196, 0.06);
  --up:          #3ecf8e;
  --warn:        #e0a050;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --max: 66rem;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.25,.46,.45,.94);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font: 400 1.0625rem/1.6 var(--sans);
  background-image:
    radial-gradient(900px 420px at 85% -5%, var(--accent-flare), transparent 65%),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
}
/* fade the grid so it reads as texture, not a chart */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 0%, transparent 0%, var(--bg) 78%); opacity: .92; }
main, header, footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-bright); text-decoration: underline; text-underline-offset: .2em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--bg); padding: .5rem 1rem; }
.skip:focus { left: 1rem; z-index: 10; }

.mono { font-family: var(--mono); font-size: .8125rem; letter-spacing: .01em; }
.muted { color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0; }

/* Masthead */
.masthead { max-width: var(--max); margin: 0 auto; padding: 1.4rem 1.5rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em; color: var(--text-bright); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-word { display: inline; }
.brand-lab { color: var(--accent); font-weight: 400; }
.brand-tld { color: var(--dim); font-weight: 400; font-family: var(--mono); font-size: .85rem; margin-left: .1rem; }
.masthead nav { display: flex; gap: 1.4rem; }
.masthead nav a { color: var(--muted); font-size: .92rem; padding: .25rem 0; border-bottom: 1.5px solid transparent; }
.masthead nav a:hover { color: var(--text-bright); text-decoration: none; }
.masthead nav a[aria-current="page"] { color: var(--text-bright); border-bottom-color: var(--accent); }

main { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem 4rem; }
main > section { margin-top: 4rem; }
main > section:first-child { margin-top: 3rem; }

/* Type */
.eyebrow { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-dim); margin: 0 0 .9rem; }
.display { font-weight: 600; font-size: clamp(2.3rem, 5.5vw, 3.9rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 1rem; color: var(--text-bright); animation: rise .6s var(--ease) both; }
.lede { font-size: clamp(1.1rem, 1.9vw, 1.3rem); line-height: 1.5; max-width: 40ch; margin: 0; color: var(--text); animation: rise .6s .07s var(--ease) both; }
.hero-compact .lede { max-width: 56ch; color: var(--muted); }
h2 { font-weight: 600; font-size: 1.55rem; letter-spacing: -.02em; margin: 0 0 1rem; color: var(--text-bright); }
h3 { font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; margin: 0 0 .35rem; color: var(--text-bright); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .display, .lede, .hero-actions, .portrait { animation: none !important; } }

/* Home hero: portrait + copy */
.hero-home { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3rem; align-items: center; }
@media (max-width: 46rem) { .hero-home { grid-template-columns: 1fr; gap: 1.5rem; } .portrait { width: 9rem; } }
.portrait { width: 15rem; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: 60% 30%; display: block;
  border: 2px solid var(--border-hi); box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--border), 0 0 60px var(--accent-glow);
  animation: rise .6s .05s var(--ease) both; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.6rem; animation: rise .6s .14s var(--ease) both; }
.btn { display: inline-block; padding: .6rem 1.05rem; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 600; font-size: .92rem; border: 1px solid var(--accent); transition: transform .15s var(--ease), background .15s; }
.btn:hover { background: var(--text-bright); border-color: var(--text-bright); color: var(--bg); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-hi); }
.btn-ghost:hover { background: var(--surface-hi); border-color: var(--accent); color: var(--text-bright); }

/* Home: the one-line facts strip */
.facts { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: 2.2rem 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.facts li::before { content: "//"; color: var(--dim); margin-right: .5rem; }

/* Cards and sections */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.more { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem 1.4rem; }
.card-title { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 .7rem; font-weight: 500; }
.card p { margin: 0; font-size: .96rem; color: var(--text); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 3rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 52rem) { .two-col, .grid-3 { grid-template-columns: 1fr; } }
.prose p { max-width: 62ch; }
.prose > p:first-child { margin-top: 0; }
.ticks { list-style: none; padding: 0; margin: .5rem 0 0; }
.ticks li { position: relative; padding-left: 1.3rem; margin: .45rem 0; max-width: 66ch; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .7em; width: .6rem; height: 2px; background: var(--accent); }

/* Status stamps */
.stamp { display: inline-block; font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; padding: .18rem .5rem; border: 1px solid currentColor; border-radius: 4px; color: var(--muted); background: var(--bg-subtle); }
[data-status="live"] .stamp, .stamp[data-status="live"] { color: var(--up); box-shadow: 0 0 12px rgba(62,207,142,.18); }
[data-status="in-progress"] .stamp, .stamp[data-status="in-progress"] { color: var(--warn); }
[data-status="archived"] .stamp, .stamp[data-status="archived"] { color: var(--muted); }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; margin-top: 1.4rem; color: var(--muted); }
.legend .stamp { margin-right: .3rem; }

/* Project grid (home) */
.project-grid { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 60rem) { .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 38rem) { .project-grid { grid-template-columns: 1fr; } }
.project { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem 1.3rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.project:hover { border-color: var(--accent-dim); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.35), 0 0 0 1px var(--accent-flare); }
.project-head { display: flex; justify-content: space-between; align-items: center; }
.project h3 a { color: var(--text-bright); }
.project h3 a:hover { color: var(--accent); text-decoration: none; }
.project p { margin: 0; font-size: .96rem; }
.project .stack { margin-top: auto; padding-top: .8rem; color: var(--muted); }
.since { color: var(--dim); }

/* Project list (projects page) */
.project-list { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.project-full { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 2rem; padding: 2rem 2rem 1.9rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); scroll-margin-top: 2rem; transition: border-color .2s; }
.project-full:hover, .project-full:target { border-color: var(--accent-dim); }
@media (max-width: 52rem) { .project-full { grid-template-columns: 1fr; gap: .75rem; padding: 1.4rem 1.25rem; } }
.project-meta { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; }
.project-meta a { word-break: break-all; }
.project-full h2 { font-size: 1.45rem; margin: 0 0 .2rem; }
.project-full h2 a { color: var(--text-bright); }
.project-full h2 a:hover { color: var(--accent); text-decoration: none; }
.project-full .pitch { font-size: 1.08rem; color: var(--text); margin: 0 0 .7rem; }
.project-full p { max-width: 66ch; }
.project-full .stack { color: var(--muted); margin-top: 1rem; }

/* Homelab */
.principles dt { font-weight: 600; margin-top: 1rem; color: var(--text-bright); }
.principles dd { margin: .2rem 0 0; color: var(--muted); max-width: 60ch; }
.topo { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.2rem; }
.topo-tier { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.1rem 1.25rem; }
.topo-label { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-dim); margin: 0 0 .8rem; }
.topo-text { margin: 0; color: var(--text); font-size: .98rem; line-height: 1.55; }
.topo-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.topo-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 52rem) { .topo-row, .topo-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .topo-row, .topo-row-2 { grid-template-columns: 1fr; } }
.topo-node { background: var(--surface-hi); border: 1px solid var(--accent-dim); border-radius: var(--r-sm); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: inset 0 0 0 1px var(--accent-flare); }
.topo-node strong { color: var(--text-bright); font-weight: 600; }
.topo-node span { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.topo-node-dim { border-color: var(--border-hi); box-shadow: none; }
.topo-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.topo-chip { font-family: var(--mono); font-size: .78rem; color: var(--text); background: var(--surface-hi); border: 1px solid var(--border-hi); border-radius: 999px; padding: .3rem .75rem; }
.topo-edge { border-style: dashed; }

/* Resume */
.resume-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; }
.resume-section { margin-top: 3.2rem; }
.entry { padding: 1.2rem 0; border-top: 1px solid var(--border); }
.entry-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.entry-head p { margin: 0; }
.entry .org { color: var(--muted); font-weight: 400; }
.entry > p { max-width: 70ch; }
.skills dt { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-dim); margin-top: 1rem; }
.skills dd { margin: .25rem 0 0; max-width: 80ch; }

/* Footer */
.colophon { max-width: var(--max); margin: 0 auto; padding: 1.6rem 1.5rem 2.4rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.colophon a { color: var(--muted); }
.colophon a:hover { color: var(--accent); }
.colophon-links { display: flex; gap: 1.2rem; }

@media print {
  html, body { background: #fff; color: #000; font-size: 10.5pt; }
  body::before, .masthead, .colophon, .print-hint, .btn, .hero-actions { display: none !important; }
  main { max-width: none; padding: 0; }
  .display, h2, h3, .entry .org { color: #000; }
  .display { font-size: 22pt; animation: none; }
  .muted, .stack, .skills dt { color: #444; }
  .hero, .resume-section { margin-top: 1rem; }
  .entry { break-inside: avoid; padding: .5rem 0; border-color: #ccc; }
  a { color: #000; }
  .ticks li::before { background: #000; }
}
