/* ============================================================
   christhianlacandu.com — "Signal Flow" design system
   Dark canvas · one accent (mint) · node-graph motif
   ============================================================ */

:root {
  --bg: #090b0e;
  --bg-1: #0e1116;
  --bg-2: #12161c;
  --bg-card: #0f1318;
  --ink: #eceef1;
  --muted: #8b94a0;
  --muted-2: #5b636e;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);

  --mint: #3ddc97;
  --mint-deep: #06231a;
  --mint-soft: rgba(61, 220, 151, 0.12);
  --hot: #ff6b5b;
  --warm: #ffb23e;
  --cold: #5ba8ff;

  --maxw: 1080px;
  --r: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea { font: inherit; }
::selection { background: var(--mint); color: var(--mint-deep); }

/* thin dark scrollbar */
* { scrollbar-width: thin; scrollbar-color: #20262e transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #20262e; border-radius: 20px; }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--mint); color: var(--mint-deep);
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 700;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- atmosphere ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.glow {
  position: fixed; top: -30vh; left: 50%; transform: translateX(-50%);
  width: 120vw; height: 80vh; z-index: 0; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(61, 220, 151, 0.10), transparent 70%);
  filter: blur(20px);
}

/* ---------- shared layout ---------- */
.section {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin-inline: auto;
  padding: clamp(64px, 11vw, 132px) clamp(20px, 5vw, 40px);
  scroll-margin-top: 84px;
}
.section__head { margin-bottom: clamp(32px, 5vw, 56px); max-width: 720px; }
.section__title {
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; margin-top: 14px;
}
.section__note { color: var(--muted); margin-top: 16px; max-width: 56ch; font-size: 1.02rem; }

.eyebrow {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--mint);
  display: inline-flex; align-items: center; gap: 12px;
}
.node-tag {
  display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 7px;
  border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--muted); background: var(--bg-1); font-size: 0.7rem; letter-spacing: 0.1em;
  position: relative;
}
.node-tag::before {
  content: ""; position: absolute; right: -13px; width: 13px; height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 40px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand__mark { width: 26px; height: 26px; color: var(--mint); display: grid; place-items: center; }
.brand__mark svg { width: 100%; height: 100%; }
.brand__text { font-size: 1.02rem; }
.brand__text::after { content: ".dev"; color: var(--muted-2); font-weight: 500; }

.nav__right { display: flex; align-items: center; gap: clamp(12px, 3vw, 22px); }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--muted);
}
.status__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); animation: pulse 2.4s infinite var(--ease);
}
.lang { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.8rem; }
.lang__btn { color: var(--muted-2); padding: 4px 4px; transition: color 0.2s; font-weight: 700; }
.lang__btn:hover { color: var(--ink); }
.lang__btn.is-active { color: var(--mint); }
.lang__sep { color: var(--muted-2); }

@media (max-width: 560px) { .status { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
  border: 1px solid transparent; position: relative; white-space: nowrap;
}
.btn--primary { background: var(--mint); color: var(--mint-deep); box-shadow: 0 0 0 0 var(--mint-soft); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 38px -12px rgba(61, 220, 151, 0.55); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--mint); color: var(--mint); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 2;
  min-height: 94vh; display: flex; flex-direction: column; justify-content: center;
  max-width: var(--maxw); margin-inline: auto;
  padding: 90px clamp(20px, 5vw, 40px) 120px;
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.9; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; opacity: 0.4;
  mask-image: radial-gradient(60% 60% at 30% 40%, #000, transparent 75%);
}
.hero__inner { max-width: 760px; }
.hero__title {
  font-size: clamp(2.8rem, 9vw, 6rem); font-weight: 800; line-height: 0.96;
  letter-spacing: -0.045em; margin: 18px 0 0;
}
.hero__tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 600; color: var(--mint);
  margin-top: 18px; letter-spacing: -0.02em;
}
.hero__lede { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.18rem); max-width: 52ch; margin-top: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__hint {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px;
  font-family: var(--mono); font-size: 0.74rem; color: var(--muted-2); letter-spacing: 0.02em;
}
.hero__hint-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); animation: pulse 2.4s infinite var(--ease); flex: none; }

.scrollcue {
  position: absolute; left: clamp(20px, 5vw, 40px); bottom: 30px;
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted-2);
}
.scrollcue__line { width: 54px; height: 1px; background: linear-gradient(90deg, var(--mint), transparent); position: relative; overflow: hidden; }
.scrollcue__line::after { content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 100%; background: var(--mint); animation: trace 2.6s infinite var(--ease); }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(28px, 6vw, 64px); align-items: start; }
.about__body { font-size: clamp(1.05rem, 1.8vw, 1.32rem); line-height: 1.7; color: #c2c8d0; }
.stats { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--bg-1); padding: 20px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat__num { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--mint); letter-spacing: -0.02em; }
.stat__label { font-size: 0.82rem; color: var(--muted); }

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

/* ---------- cards / nodes ---------- */
.cards { display: grid; gap: 18px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--projects { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px 24px 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.card:hover {
  transform: translateY(-4px); border-color: color-mix(in srgb, var(--mint) 45%, var(--line-2));
  box-shadow: 0 22px 50px -28px rgba(0, 0, 0, 0.9); background: var(--bg-1);
}
/* node ports */
.node__port {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--line-2); transform: translateY(-50%);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.node__port--in { left: -5px; }
.node__port--out { right: -5px; }
.card:hover .node__port { border-color: var(--mint); background: var(--mint); box-shadow: 0 0 12px 1px rgba(61, 220, 151, 0.6); }

.card__idx { position: absolute; top: 18px; right: 20px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted-2); }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  color: var(--mint); background: var(--mint-soft); border: 1px solid color-mix(in srgb, var(--mint) 24%, transparent);
  margin-bottom: 18px;
}
.card__icon svg { width: 24px; height: 24px; }
.card__title { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.02em; }
.card__desc { color: var(--muted); margin-top: 10px; font-size: 0.96rem; line-height: 1.62; }

.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.tag {
  flex: none; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--line); padding: 5px 9px; border-radius: 999px; white-space: nowrap;
}
.tag--live { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 40%, transparent); }
.card--feature { grid-column: 1 / -1; background: linear-gradient(135deg, var(--bg-1), var(--bg-card)); }
.card--feature .card__title { font-size: 1.5rem; }
.card--feature .card__desc { max-width: 62ch; font-size: 1.02rem; }
.card__link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--mint);
  border-bottom: 1px solid transparent; transition: border-color 0.2s; width: fit-content;
}
.card__link:hover { border-color: var(--mint); }

@media (max-width: 860px) { .cards--3 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .cards--projects { grid-template-columns: 1fr; } }

/* ---------- certifications ---------- */
.certgrid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cert {
  display: flex; align-items: center; gap: 14px; padding: 20px 22px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.cert:hover { border-color: color-mix(in srgb, var(--mint) 40%, var(--line)); transform: translateY(-3px); }
.cert__check {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint-soft); color: var(--mint); border: 1px solid color-mix(in srgb, var(--mint) 30%, transparent);
  font-size: 0.8rem; font-weight: 700;
}
.cert__name { font-weight: 600; letter-spacing: -0.01em; }
@media (max-width: 560px) { .certgrid { grid-template-columns: 1fr; } }

/* ---------- contact / runner node ---------- */
.runner {
  position: relative; background: var(--bg-card); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 0; overflow: hidden;
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 1);
}
.runner__bar {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: var(--bg-1);
  font-family: var(--mono); font-size: 0.76rem;
}
.runner__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); transition: background 0.3s, box-shadow 0.3s; flex: none; }
.runner__path { color: var(--muted); letter-spacing: 0.02em; }
.runner__state { margin-left: auto; color: var(--muted-2); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.68rem; }

.runner.is-running .runner__dot { background: var(--warm); box-shadow: 0 0 10px 1px rgba(255, 178, 62, 0.7); animation: pulse-fast 1s infinite; }
.runner.is-running .runner__state { color: var(--warm); }
.runner.is-done .runner__dot { background: var(--mint); box-shadow: 0 0 10px 1px rgba(61, 220, 151, 0.7); }
.runner.is-done .runner__state { color: var(--mint); }
.runner.is-error .runner__dot { background: var(--hot); box-shadow: 0 0 10px 1px rgba(255, 107, 91, 0.7); }
.runner.is-error .runner__state { color: var(--hot); }
.runner.is-done .node__port--out, .runner.is-running .node__port--out { border-color: var(--mint); background: var(--mint); box-shadow: 0 0 12px 1px rgba(61, 220, 151, 0.6); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px clamp(20px, 4vw, 30px) 8px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field__opt { color: var(--muted-2); text-transform: none; }
.field input, .field textarea {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 13px 15px; color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--hot); box-shadow: 0 0 0 3px rgba(255, 107, 91, 0.12); }

.btn--submit { grid-column: 1 / -1; justify-self: start; margin: 8px 0 24px; }
.btn__spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(6, 35, 26, 0.35);
  border-top-color: var(--mint-deep); display: none; animation: spin 0.7s linear infinite;
}
.runner.is-running .btn--submit { pointer-events: none; opacity: 0.85; }
.runner.is-running .btn__spinner { display: inline-block; }

/* result output */
.result { margin: 0 clamp(20px, 4vw, 30px) 28px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-1); padding: 20px 22px; animation: rise 0.5s var(--ease) both; }
.result.is-success { border-color: color-mix(in srgb, var(--mint) 45%, transparent); }
.result.is-error { border-color: color-mix(in srgb, var(--hot) 45%, transparent); }
.result.is-duplicate { border-color: color-mix(in srgb, var(--warm) 45%, transparent); }
.result__head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.result__head .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.result.is-success .dot { background: var(--mint); }
.result.is-error .dot { background: var(--hot); }
.result.is-duplicate .dot { background: var(--warm); }
.result__msg { color: var(--muted); margin-top: 8px; font-size: 0.96rem; }

.score { display: flex; align-items: center; gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.score__meter { display: flex; flex-direction: column; gap: 6px; }
.score__label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.score__num { font-family: var(--mono); font-size: 2rem; font-weight: 700; line-height: 1; }
.badge {
  margin-left: auto; font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 16px; border-radius: 999px;
  border: 1px solid currentColor; display: inline-flex; align-items: center; gap: 8px;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.is-hot { color: var(--hot); background: rgba(255, 107, 91, 0.1); }
.badge.is-warm { color: var(--warm); background: rgba(255, 178, 62, 0.1); }
.badge.is-cold { color: var(--cold); background: rgba(91, 168, 255, 0.1); }
.score__num.is-hot { color: var(--hot); }
.score__num.is-warm { color: var(--warm); }
.score__num.is-cold { color: var(--cold); }

.result__fallback { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.result__fallback a {
  font-family: var(--mono); font-size: 0.8rem; color: var(--mint);
  border: 1px solid color-mix(in srgb, var(--mint) 35%, transparent); padding: 8px 14px; border-radius: 999px;
  transition: background 0.2s, transform 0.2s;
}
.result__fallback a:hover { background: var(--mint-soft); transform: translateY(-2px); }

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

/* ---------- footer ---------- */
.footer { position: relative; z-index: 2; max-width: var(--maxw); margin-inline: auto; padding: 50px clamp(20px, 5vw, 40px) 60px; border-top: 1px solid var(--line); }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; justify-content: space-between; }
.footer__tag { font-family: var(--mono); font-size: 0.78rem; color: var(--muted-2); letter-spacing: 0.02em; }
.footer__links { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0; }
.footer__links a {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  transition: color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
  font-size: 0.92rem; font-weight: 600;
}
.footer__links a svg { width: 17px; height: 17px; }
.footer__links a:hover { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 45%, transparent); transform: translateY(-2px); }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted-2); font-family: var(--mono); letter-spacing: 0.02em; }
.footer__back { margin-left: auto; color: var(--muted); transition: color 0.2s; }
.footer__back:hover { color: var(--mint); }

/* ---------- motion: load stagger + scroll reveal ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
@keyframes pulse-fast { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes trace { 0% { transform: translateX(-16px); } 100% { transform: translateX(56px); } }

.js .hero__inner > * { opacity: 0; animation: rise 0.8s var(--ease) forwards; }
.js .hero__inner > *:nth-child(1) { animation-delay: 0.05s; }
.js .hero__inner > *:nth-child(2) { animation-delay: 0.14s; }
.js .hero__inner > *:nth-child(3) { animation-delay: 0.23s; }
.js .hero__inner > *:nth-child(4) { animation-delay: 0.32s; }
.js .hero__inner > *:nth-child(5) { animation-delay: 0.41s; }
.js .hero__inner > *:nth-child(6) { animation-delay: 0.50s; }

.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@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; }
  .js .hero__inner > *, .js .reveal { opacity: 1; transform: none; }
}
