/* ============================================================
   Natanael Setiawan Portfolio
   Theme: dark, one emerald accent, Satoshi + JetBrains Mono
   ============================================================ */

:root {
  --bg: #0b100e;
  --bg-tint: #0e1512;
  --surface: #121a16;
  --line: rgba(214, 235, 224, 0.09);
  --text: #e6ede9;
  --text-dim: #97a49d;
  --accent: #46c99a;
  --accent-strong: #5fdcae;
  --accent-dim: rgba(70, 201, 154, 0.14);
  --font-sans: "Satoshi", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
  /* z-scale: 1 content overlays, 5 nav, 20 skip-link */
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

em { font-style: italic; }

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

/* ---------- typography helpers ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 20px;
}

.section__title {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 56px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s, border-color 0.25s, color 0.25s;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #07110d;
}
.btn--primary:hover { background: var(--accent-strong); transform: translateY(-1px); }

.btn--ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }

.btn--lg { padding: 17px 38px; font-size: 1.05rem; }

.text-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  font-size: 0.92rem;
}
.text-link:hover { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
  padding: 0 max(24px, calc((100vw - 1200px) / 2 + 24px));
  background: rgba(11, 16, 14, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__brand {
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.nav__brand-dot { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 32px;
}
.nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 10px 2px;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--text); }

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 20;
  background: var(--accent);
  color: #07110d;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 0 0 12px 12px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#scene { width: 100%; height: 100%; display: block; }

/* Fallback when WebGL / the 3D library is unavailable: a designed ambient
   backdrop so the hero is never a blank black rectangle on any device. */
.hero--no-webgl .hero__canvas-wrap {
  background-color: transparent;
  background-image:
    radial-gradient(closest-side, rgba(70, 201, 154, 0.16), transparent 72%),
    radial-gradient(rgba(70, 201, 154, 0.06) 1px, transparent 1.4px);
  background-repeat: no-repeat, repeat;
  background-position: 74% 50%, 0 0;
  background-size: 64% 82%, 24px 24px;
}
.hero--no-webgl #scene { display: none; }

@media (max-width: 768px) {
  .hero--no-webgl .hero__canvas-wrap {
    background-position: 50% 22%, 0 0;
    background-size: 90% 44%, 22px 22px;
  }
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 68px 24px 48px;
}

.hero__content { max-width: 620px; }

.hero__title {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 24px;
}
.hero__title em {
  color: var(--accent);
}

.hero__sub {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 46ch;
  margin-bottom: 36px;
}

.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- current role strip ---------- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-tint);
  padding: 18px 0;
}
.strip__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.strip__now {
  font-size: 0.92rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.strip__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .strip__pulse { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(70, 201, 154, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(70, 201, 154, 0); }
  }
}
.strip__stack { color: var(--text-dim); }

/* ---------- sections ---------- */

.section { padding: 120px 0; }
.section--tint { background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- bento ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.bento__cell {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.bento__cell:hover { border-color: rgba(70, 201, 154, 0.35); transform: translateY(-3px); }

.bento__cell--wide { grid-column: span 2; }

.bento__glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(70, 201, 154, 0.16), transparent 65%);
  pointer-events: none;
}

.bento__cell h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.bento__cell p {
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 22px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.tag-row li {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- timeline ---------- */

.timeline { list-style: none; }

.timeline__item {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.timeline__item:last-child { border-bottom: 1px solid var(--line); }

.timeline__meta { display: flex; flex-direction: column; gap: 6px; }
.timeline__date { color: var(--accent); }
.timeline__org { color: var(--text-dim); font-size: 0.9rem; }

.timeline__body h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.timeline__body p { color: var(--text-dim); max-width: 68ch; }

/* ---------- projects ---------- */

.project {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0;
}
.project + .project { border-top: 1px solid var(--line); }

.project--flip .project__info { order: 2; }
.project--flip .project__visual { order: 1; }

.project__info h3 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 18px;
}
.project__info > p { color: var(--text-dim); margin-bottom: 24px; }

.project__facts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.project__facts li {
  position: relative;
  padding-left: 22px;
  color: var(--text);
  font-size: 0.95rem;
}
.project__facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 10px;
  height: 2px;
  background: var(--accent);
}

.project__links { display: flex; gap: 24px; flex-wrap: wrap; }

/* flow diagram */

.project__visual {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 32px;
}

.flow {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow__stage {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.flow__node {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 10px 18px;
  border-radius: 10px;
}
.flow__node--accent {
  border-color: rgba(70, 201, 154, 0.45);
  color: var(--accent-strong);
  background: var(--accent-dim);
}
.flow__sub { color: var(--text-dim); }
.flow__arrow {
  width: 2px;
  height: 26px;
  margin: 6px 0 6px 24px;
  background: linear-gradient(var(--line), var(--accent));
}

/* telegram bot commands */

.bot-cmds {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.bot-cmds__title {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.bot-cmds ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}
.bot-cmds li {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.bot-cmds li .mono:first-child { color: var(--accent-strong); }
.bot-cmds li span:last-child {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* animated screenshot cards (GSAP: reveal on scroll + pointer tilt) */

.shot {
  display: block;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  will-change: transform;
  transform: perspective(800px);
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bot-shots {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.bot-shots .shot { aspect-ratio: 9 / 16; }

.wf__card-shot {
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
}
.wf__card-shot img { object-position: top; }

/* workflow library */

.wf { margin-top: 72px; }
.wf__title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.wf__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.wf__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf__card:hover { border-color: rgba(70, 201, 154, 0.35); transform: translateY(-3px); }
.wf__card h4 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.wf__card p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.55; }

/* metrics grid */

.project__visual--metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  background: none;
  border: none;
  padding: 0;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric:first-child {
  background: linear-gradient(145deg, rgba(70, 201, 154, 0.13), var(--surface) 70%);
  border-color: rgba(70, 201, 154, 0.3);
}
.metric__label { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.68rem; }
.metric__value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-mono); }
.metric__note { color: var(--text-dim); font-size: 0.82rem; }

/* ---------- certifications: one horizontal strip, newest first ---------- */

.cert-strip-wrap {
  position: relative;
  margin-bottom: 32px;
}
.cert-strip-wrap::before,
.cert-strip-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 20px;
  width: 56px;
  pointer-events: none;
  z-index: 1;
}
.cert-strip-wrap::before { left: 0; background: linear-gradient(to right, var(--bg-tint), transparent); }
.cert-strip-wrap::after { right: 0; background: linear-gradient(to left, var(--bg-tint), transparent); }

.cert-strip__nav {
  position: absolute;
  top: 0;
  bottom: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: auto 0;
  height: 36px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.cert-strip__nav--prev { left: 4px; }
.cert-strip__nav--next { right: 4px; }
.cert-strip__nav:hover:not(:disabled) { border-color: rgba(70, 201, 154, 0.5); color: var(--accent-strong); transform: translateY(-1px); }
.cert-strip__nav:disabled { opacity: 0.3; cursor: default; }

.cert-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 4px 20px;
  margin: 0 -4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.cert-strip::-webkit-scrollbar { height: 6px; }
.cert-strip::-webkit-scrollbar-track { background: transparent; }
.cert-strip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.cert-strip::-webkit-scrollbar-thumb:hover { background: rgba(70, 201, 154, 0.4); }

.cert-card {
  scroll-snap-align: start;
  flex: 0 0 176px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cert-card:hover { border-color: rgba(70, 201, 154, 0.35); transform: translateY(-3px); }
.cert-card img { width: 48px; height: 48px; object-fit: contain; }
.cert-card__name { font-size: 0.85rem; font-weight: 700; line-height: 1.35; }
.cert-card__meta { color: var(--text-dim); font-size: 0.7rem; }

.certs__edu { color: var(--text-dim); font-size: 0.92rem; display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }

/* ---------- contact ---------- */

.contact { padding: 160px 0 120px; text-align: left; }

.contact__title {
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: 24px;
}
.contact__title em {
  color: var(--accent);
  line-height: 1.1;
  display: inline-block;
  padding-bottom: 6px;
}

.contact__sub {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 40px;
  max-width: 48ch;
}

.contact__actions { margin-bottom: 56px; }

.contact__channels {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 560px;
}
.contact__channels li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}
.contact__channels li:last-child { border-bottom: 1px solid var(--line); }
.contact__channels .mono { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; }
.contact__channels a {
  display: inline-block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.contact__channels a:hover { color: var(--accent-strong); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}
.footer__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ---------- reveal animation ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .reveal[data-delay="1"] { transition-delay: 0.08s; }
  .reveal[data-delay="2"] { transition-delay: 0.16s; }
  .reveal[data-delay="3"] { transition-delay: 0.24s; }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
  /* keyboard focus must never land on invisible content */
  .reveal:focus-within {
    opacity: 1;
    transform: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; gap: 32px; }
  .project--flip .project__info { order: 2; }
  .project--flip .project__visual { order: 1; }
  .timeline__item { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 768px) {
  .nav { height: 60px; gap: 10px; }
  .nav__cta { display: none; }
  /* keep the four labels on one line at every phone width; swipe if tight */
  .nav__links {
    gap: 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__links a { font-size: 0.82rem; padding: 8px 0; white-space: nowrap; }
  .nav__brand { font-size: 1.1rem; }

  .section { padding: 80px 0; }

  .bento { grid-template-columns: 1fr; }
  .bento__cell--wide { grid-column: span 1; }
  .bento__cell { padding: 28px; }

  .hero__content { max-width: 100%; }
  .hero__inner { padding-top: 100px; }

  .strip__row { flex-direction: column; align-items: flex-start; }

  .project__visual { padding: 28px 22px; }
  .project__visual--metrics { padding: 0; grid-template-columns: 1fr 1fr; }

  .wf__grid { grid-template-columns: 1fr; }
  .bot-cmds ul { grid-template-columns: 1fr; }

  .footer__row { flex-direction: column; }
}

@media (max-width: 400px) {
  .container { padding: 0 16px; }
  .nav { padding: 0 16px; }
  .cert-card { flex-basis: 156px; }
  .hero__title { font-size: 2.1rem; }
  .contact__title { font-size: 2.3rem; }
  .project__visual--metrics { grid-template-columns: 1fr; }
}
