/* ============================================================
   Rendi Sutendi — CV / Portfolio
   Editorial, restrained. Pure CSS. Light & dark theme.
   ============================================================ */

:root {
  --green: #2f7d5b;
  --green-ink: #245f46;
  --paper: #fbfaf7;          /* warm off-white */
  --paper-alt: #f3f1ea;
  --card: #ffffff;
  --line: #e4e0d6;
  --ink: #232220;
  --ink-soft: #5f5c55;
  --ink-faint: #908c83;

  --radius: 14px;
  --maxw: 1060px;
  --nav-h: 68px;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --green: #6cc79b;
  --green-ink: #8ad6b2;
  --paper: #16181a;
  --paper-alt: #1b1e20;
  --card: #1f2225;
  --line: #2e3236;
  --ink: #ecebe7;
  --ink-soft: #b3b0a8;
  --ink-faint: #807d76;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
ul, dl { list-style: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid transparent; transition: border-color .25s;
}
.navbar.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; letter-spacing: .2px; }

.nav-links { display: flex; gap: 6px; }
.nav-link {
  padding: 6px 12px; font-size: .92rem; color: var(--ink-soft);
  border-radius: 7px; transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--green-ink); }
.nav-link.active::after { content: ""; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  display: grid; place-items: center; transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--green); color: var(--green-ink); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; color: var(--ink); }
.menu-toggle span { width: 20px; height: 2px; background: currentColor; transition: .25s; }
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 64px; }
.hero-inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: center; }
.hero-tag {
  font-size: .82rem; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--green-ink); margin-bottom: 16px;
}
.hero-name {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.04; letter-spacing: -0.5px; margin-bottom: 20px;
}
.hero-desc { font-size: 1.08rem; color: var(--ink-soft); max-width: 540px; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 28px; margin: 28px 0; }
.hero-meta li { font-size: .95rem; font-weight: 500; }
.hero-meta span { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-faint); margin-bottom: 2px; font-weight: 600; }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; border-radius: 9px; font-family: var(--sans);
  font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--green); color: #fff; }
[data-theme="dark"] .btn-primary { color: #10211a; }
.btn-primary:hover { background: var(--green-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green-ink); }

.hero-socials { font-size: .92rem; color: var(--ink-soft); }
.hero-socials a { font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.hero-socials a:hover { color: var(--green-ink); border-color: var(--green); }
.hero-socials .dot { margin: 0 8px; color: var(--ink-faint); }

.hero-photo {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-alt);
  aspect-ratio: 4 / 5; box-shadow: 0 1px 0 var(--line);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; filter: saturate(1.02); }

/* ---------- Sections ---------- */
.section { padding: 76px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--paper-alt); }
.section-head { margin-bottom: 40px; max-width: 640px; }
.section-kicker {
  font-size: .78rem; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--green-ink); margin-bottom: 8px;
}
.section-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.15; letter-spacing: -0.3px; }
.section-sub { color: var(--ink-faint); font-size: .92rem; margin-top: 8px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-lead { font-size: 1.1rem; color: var(--ink-soft); line-height: 1.8; }
.about-lead strong { color: var(--ink); font-weight: 600; }
.about-facts { display: grid; gap: 0; }
.about-facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.about-facts div:first-child { border-top: 1px solid var(--line); }
.about-facts dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-faint); font-weight: 600; }
.about-facts dd { font-size: .98rem; font-weight: 500; margin-top: 2px; }

/* Experience */
.xp-list { display: grid; gap: 22px; }
.xp {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px; transition: border-color .2s;
}
.xp:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.xp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.xp-role { font-family: var(--serif); font-weight: 600; font-size: 1.28rem; line-height: 1.25; }
.xp-company { color: var(--green-ink); font-weight: 600; font-size: .95rem; margin-top: 2px; }
.xp-date { font-size: .85rem; color: var(--ink-faint); white-space: nowrap; font-weight: 500; }
.xp-note { color: var(--ink-soft); font-size: .96rem; margin-bottom: 14px; }
.xp-points { display: grid; gap: 9px; margin-bottom: 18px; }
.xp-points li { position: relative; padding-left: 20px; color: var(--ink-soft); font-size: .95rem; }
.xp-points li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.xp-points b { color: var(--ink); font-weight: 600; }
.xp-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.xp-tags li {
  font-size: .78rem; font-weight: 500; color: var(--ink-soft);
  padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px;
}

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.skill-block { padding: 24px 22px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.skill-block:nth-child(3n) { border-right: none; }
.skill-block h3 { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin-bottom: 6px; }
.skill-block p { color: var(--ink-soft); font-size: .95rem; }
.skills-method { margin-top: 24px; color: var(--ink-soft); font-size: .95rem; }
.skills-method span { font-weight: 600; color: var(--ink); }

/* Education */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.edu-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; }
.edu-year { font-size: .8rem; color: var(--green-ink); font-weight: 600; letter-spacing: .4px; }
.edu-item h3 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; margin: 8px 0 2px; }
.edu-where { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.edu-desc { color: var(--ink-soft); font-size: .92rem; margin-top: 8px; }

/* Projects */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.proj {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.proj:hover { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); transform: translateY(-2px); }
.proj-feature { grid-column: 1 / -1; flex-direction: row; }
.proj-feature .proj-thumb { width: 46%; aspect-ratio: auto; border-bottom: none; border-right: 1px solid var(--line); }
.proj-feature .proj-body { flex: 1; }
.proj-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-alt); border-bottom: 1px solid var(--line); }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .35s ease; }
.proj:hover .proj-thumb img { transform: scale(1.03); }
.proj-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.proj-titlerow { display: flex; align-items: center; gap: 10px; }
.proj-titlerow h3 { font-family: var(--serif); font-weight: 600; font-size: 1.18rem; }
.proj-badge { font-size: .7rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #fff; background: var(--green); padding: 3px 9px; border-radius: 999px; }
[data-theme="dark"] .proj-badge { color: #10211a; }
.proj-body > p { color: var(--ink-soft); font-size: .94rem; margin: 0; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.proj-tags li { font-size: .76rem; color: var(--ink-soft); padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.proj-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.proj-links a { font-size: .88rem; font-weight: 600; color: var(--green-ink); border-bottom: 1px solid transparent; padding-bottom: 1px; }
.proj-links a:hover { border-color: var(--green); }

/* Certificates */
.cert-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.cert-filter {
  font-family: var(--sans); font-size: .86rem; font-weight: 500; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--line); transition: .2s;
}
.cert-filter:hover { border-color: var(--green); color: var(--green-ink); }
.cert-filter.is-active { background: var(--green); border-color: var(--green); color: #fff; }
[data-theme="dark"] .cert-filter.is-active { color: #10211a; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.cert.is-hidden { display: none; }
.cert { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; transition: border-color .2s, transform .2s; }
.cert:hover { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); transform: translateY(-2px); }
.cert-thumb { aspect-ratio: 16 / 11; overflow: hidden; background: var(--paper-alt); border-bottom: 1px solid var(--line); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .35s ease; }
.cert:hover .cert-thumb img { transform: scale(1.03); }
.cert figcaption { padding: 16px 18px; }
.cert figcaption h3 { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.cert figcaption p { color: var(--ink-soft); font-size: .88rem; margin-top: 2px; }

/* Contact */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.contact-sub { color: var(--ink-soft); margin: 12px 0 24px; max-width: 420px; }
.contact-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.contact-list { border-top: 1px solid var(--line); }
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-list a { display: flex; flex-direction: column; padding: 16px 4px; transition: padding-left .2s, color .2s; }
.contact-list a:hover { padding-left: 12px; color: var(--green-ink); }
.contact-list span { font-size: .76rem; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-faint); font-weight: 600; margin-bottom: 2px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer p { color: var(--ink-faint); font-size: .9rem; }
.footer-top { font-size: .9rem; color: var(--ink-soft); }
.footer-top:hover { color: var(--green-ink); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 28px;
  background: rgba(20, 22, 20, .82); backdrop-filter: blur(2px);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-close {
  position: absolute; top: 18px; right: 22px; width: 44px; height: 44px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 1.6rem; line-height: 1; border-radius: 10px; cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,.22); }

/* ---------- Reveal (subtle) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { max-width: 320px; order: -1; aspect-ratio: 1 / 1; }
  .about-grid, .contact-wrap { grid-template-columns: 1fr; gap: 28px; }
  .skill-block:nth-child(3n) { border-right: 1px solid var(--line); }
  .skill-block:nth-child(2n) { border-right: none; }
  .proj-feature { flex-direction: column; }
  .proj-feature .proj-thumb { width: 100%; aspect-ratio: 16 / 10; border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 28px 18px;
    transform: translateY(-130%); transition: transform .3s ease; box-shadow: 0 12px 24px rgba(0,0,0,.06);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-link { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .section { padding: 56px 0; }
  .edu-grid { grid-template-columns: 1fr; }
  .skill-block { border-right: none !important; }
}
@media (max-width: 420px) {
  .hero-cta .btn { flex: 1; }
  .hero-meta { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
