/* ============================================================
   Amier Nazrin | Portfolio  ·  v2 design system
   Base:   paper #FFFFFF · ink #14283C · mist #F2F5F9 · line #DEE5EC
   Accent: amber #E8A013 (deep #B77B00) · link #1B5FA8 · wa #1FAF64
   Type:   Archivo (display) · Inter (body) · IBM Plex Mono (data)
   ============================================================ */

:root {
  --paper: #ffffff;
  --ink: #14283c;
  --body-text: #33404e;
  --mist: #f2f5f9;
  --line: #dee5ec;
  --muted: #5b6b7c;
  --accent: #e8a013;
  --accent-deep: #b77b00;
  --accent-tint: #fdf3dd;
  --link: #1b5fa8;
  --green: #1faf64;
  --font-display: "Archivo", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1100px;
  --radius: 10px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--body-text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Type ---------- */

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 700; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; flex: 0 0 22px; height: 3px; background: var(--accent); }

.lede { font-size: 1.1rem; color: var(--muted); max-width: 44em; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-solid { background: var(--ink); color: #fff; }
.btn-solid:hover { background: #1d3a57; border-color: #1d3a57; }

.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { border-color: var(--accent-deep); color: var(--accent-deep); background: var(--accent-tint); }

.btn-wa { background: var(--green); border-color: var(--green); color: #fff; }
.btn-wa:hover { background: #178a4f; border-color: #178a4f; color: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-family: var(--font-mono); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.03em; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--accent-deep); }
.brand .dot { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 20px; list-style: none; }
.nav-links a { font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.nav-links a:hover, .nav-links a.active { color: var(--accent-deep); text-decoration: none; }
.nav-resume { border: 2px solid var(--ink); border-radius: 8px; padding: 7px 14px !important; }
.nav-resume:hover { border-color: var(--accent-deep); background: var(--accent-tint); }

.nav-toggle {
  display: none;
  background: none; border: 2px solid var(--ink); border-radius: 8px;
  padding: 7px 10px; font-family: var(--font-mono); font-weight: 600; font-size: 0.75rem; cursor: pointer; color: var(--ink);
}

/* ---------- Sections ---------- */

.section { padding: 84px 0; }
.section-tint { background: var(--mist); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 40px; }
.section-head .lede { margin-top: 12px; }

/* ---------- Hero ---------- */

.hero { padding: 88px 0 68px; }
.hero-kicker { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.hero h1 { max-width: 15em; }
.hero h1 .u { box-shadow: inset 0 -0.28em 0 var(--accent-tint), inset 0 -0.34em 0 transparent; border-bottom: 3px solid var(--accent); }
.hero .lede { margin-top: 20px; }
.hero-availability { margin-top: 16px; font-size: 0.9rem; color: var(--muted); display: flex; align-items: baseline; gap: 10px; max-width: 46em; }
.hero-availability .pulse { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); position: relative; top: 1px; }

.hero-stats {
  margin-top: 48px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--paper); padding: 20px 22px; }
.stat b { display: block; font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; color: var(--ink); }
.stat b::after { content: ""; display: block; width: 22px; height: 3px; background: var(--accent); margin-top: 6px; }
.stat span { font-size: 0.83rem; color: var(--muted); display: block; margin-top: 8px; }

/* ---------- Two doors ---------- */

.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.door { border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 30px 28px; background: var(--paper); }
.door h3 { font-size: 1.2rem; margin-bottom: 10px; }
.door p { color: var(--muted); margin-bottom: 18px; font-size: 0.96rem; }
.door .links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- About ---------- */

.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.about-copy p + p { margin-top: 14px; }
.portrait { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-bottom: 22px; position: relative; }
.portrait::after { content: ""; position: absolute; inset: auto 0 0 0; height: 5px; background: var(--accent); }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.portrait.missing { display: none; }
.about-side .facts-list { border-left: 3px solid var(--accent); padding-left: 20px; font-size: 0.9rem; color: var(--muted); display: grid; gap: 14px; }
.about-side b { color: var(--ink); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; display: block; margin-bottom: 3px; }

/* ---------- Help grid ---------- */

.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.help-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.help-card h3 { font-size: 1.02rem; margin-bottom: 8px; }
.help-card h3::before { content: ""; display: block; width: 22px; height: 3px; background: var(--accent); margin-bottom: 12px; }
.help-card p { font-size: 0.92rem; color: var(--muted); }

/* ---------- Case studies ---------- */

.standfirst { font-size: 1.1rem; color: var(--muted); max-width: 46em; margin-top: 12px; }

.facts {
  margin: 30px 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-size: 0.85rem;
}
.facts > div { background: var(--paper); padding: 14px 16px; }
.facts b { display: block; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep); margin-bottom: 4px; }
.facts span { color: var(--muted); }

.case-block { margin-top: 30px; }
.case-block h3 { margin-bottom: 8px; font-size: 1.02rem; }
.case-block h3::before { content: "- "; color: var(--accent); }
.case-block p, .case-block li { font-size: 0.96rem; }
.case-block ul { padding-left: 20px; margin-top: 6px; }
.case-block li + li { margin-top: 5px; }

.case-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px; }

/* Signature: pipeline stepper */
.pipeline { margin: 24px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; }
.pipeline li {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 7px 12px; border: 1.5px solid var(--ink); border-radius: 6px;
  background: var(--paper); color: var(--ink); white-space: nowrap;
}
.pipeline li.on { background: var(--ink); color: #fff; }
.pipeline li.hot { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.pipeline .arrow { border: 0; padding: 0; color: var(--accent-deep); font-size: 0.9rem; }

/* Screenshots */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 32px 0 4px; }
.shots.two { grid-template-columns: repeat(2, 1fr); }
.shot { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.shot figcaption { padding: 11px 14px; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--line); }
.shot figcaption b { color: var(--ink); font-family: var(--font-mono); font-size: 0.72rem; }
.shot.missing img { display: none; }
.shot.missing::before {
  content: "Add assets/" attr(data-file);
  display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 4 / 3; padding: 20px; font-size: 0.8rem; font-family: var(--font-mono); color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--mist), var(--mist) 12px, #e9eef4 12px, #e9eef4 24px);
}

.case-cta { margin-top: 32px; }

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

.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.project {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 12px;
}
.project.featured-card { grid-column: 1 / -1; border-left: 4px solid var(--accent); }
.project .tag { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep); }
.project h3 { font-size: 1.15rem; }
.project > p { font-size: 0.94rem; }
.proofs { list-style: none; display: grid; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.proofs li { padding-left: 16px; position: relative; }
.proofs li::before { content: "▸"; position: absolute; left: 0; color: var(--accent-deep); }
.proofs b { color: var(--ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin-top: auto; }
.chips li {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 6px; background: var(--mist); border: 1px solid var(--line); color: var(--muted);
}

.also-built {
  margin-top: 22px; padding: 18px 24px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  font-size: 0.92rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
}
.also-built b { color: var(--ink); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- How I work ---------- */

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.method { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.method::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-mono); font-weight: 600; font-size: 1.15rem; color: var(--accent-deep);
  display: block; margin-bottom: 8px;
}
.method h3 { margin-bottom: 6px; font-size: 1rem; }
.method p { font-size: 0.88rem; color: var(--muted); }

/* ---------- Services ---------- */

.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.service { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; }
.service h3 { margin-bottom: 10px; font-size: 1.08rem; }
.service h3::before { content: ""; display: block; width: 22px; height: 3px; background: var(--accent); margin-bottom: 12px; }
.service p { font-size: 0.94rem; }
.service .you-get { margin-top: 12px; font-size: 0.86rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 11px; }
.service .you-get b { color: var(--accent-deep); font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.services-cta { margin-top: 30px; text-align: center; }
.services-cta p { color: var(--muted); margin-bottom: 14px; }
.services-cta .btn-row { justify-content: center; margin-top: 0; }

/* ---------- Skills ---------- */

.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 40px; }
.skill-group h3 { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep); margin-bottom: 10px; }

/* ---------- Experience ---------- */

.xp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 40px; }
.timeline { border-left: 2px solid var(--line); }
.job { position: relative; padding: 0 0 36px 32px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -8px; top: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--accent);
}
.job .when { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.job h3 { margin: 5px 0 2px; }
.job .org { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; }
.job ul { padding-left: 20px; }
.job li { font-size: 0.94rem; }
.job li + li { margin-top: 5px; }
.xp-thread { margin-top: 30px; font-style: italic; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 18px; }
.edu { margin-top: 36px; display: grid; gap: 5px; font-size: 0.9rem; color: var(--muted); }
.edu b { color: var(--ink); }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; }
.contact-card h3 { margin-bottom: 10px; }
.contact-card p { color: var(--muted); margin-bottom: 16px; font-size: 0.95rem; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 30px 0; font-size: 0.84rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Reveal ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .about-grid, .case-cols, .services-grid, .projects-grid, .contact-grid, .doors { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr 1fr; }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .shots, .shots.two { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .about-side { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
  .portrait { margin-bottom: 0; }
}

@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .hero { padding: 60px 0 52px; }
  .help-grid, .method-grid, .shots, .shots.two { grid-template-columns: 1fr; }
  .hero-stats, .facts { grid-template-columns: 1fr; }
  .about-side { grid-template-columns: 1fr; }
  .portrait { max-width: 260px; }

  .nav-links {
    position: fixed; inset: 64px 0 auto 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start;
    padding: 18px 24px 24px; gap: 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ============================================================
   v2.1 additions: lightbox, collapsible breakdowns, steps strip
   ============================================================ */

/* ---------- Zoomable screenshots + lightbox ---------- */

.shot.zoom img { cursor: zoom-in; }
.shot .zoom-hint { float: right; font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent-deep); }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 4vh 4vw;
  background: rgba(16, 28, 42, 0.92);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 86vh;
  border-radius: 8px; background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox figcaption {
  position: absolute; left: 0; right: 0; bottom: 3vh;
  text-align: center; color: #cfd9e4;
  font-size: 0.85rem; padding: 0 6vw;
}
.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  background: none; border: 2px solid #cfd9e4; border-radius: 8px;
  color: #fff; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  padding: 8px 14px; cursor: pointer;
}
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }
body.lightbox-active { overflow: hidden; }

/* ---------- Collapsible case-study breakdowns ---------- */

details.breakdown { margin-top: 30px; }
details.breakdown > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.86rem; font-weight: 700;
  color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px;
  padding: 11px 18px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
details.breakdown > summary::-webkit-details-marker { display: none; }
details.breakdown > summary::after {
  content: "+"; font-family: var(--font-mono); font-weight: 600; color: var(--accent-deep);
}
details.breakdown[open] > summary::after { content: "–"; }
details.breakdown > summary:hover { border-color: var(--accent-deep); background: var(--accent-tint); }
details.breakdown[open] > summary { margin-bottom: 4px; }

/* ---------- Engagement steps strip (Services) ---------- */

.steps { margin: 6px 0 30px; }
.steps .pipeline { margin: 0; }

/* ---------- Testimonial ---------- */

.testimonial {
  margin-top: 34px;
  border-left: 4px solid var(--accent);
  background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0;
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 24px 28px;
  max-width: 46em;
}
.testimonial blockquote { font-size: 1.02rem; color: var(--body-text); font-style: italic; }
.testimonial cite { display: block; margin-top: 12px; font-style: normal; font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

/* ---------- Hero quick links ---------- */

.hero-links { margin-top: 14px; font-family: var(--font-mono); font-size: 0.78rem; }
.hero-links a { color: var(--ink); border-bottom: 2px solid var(--accent); }
.hero-links a:hover { color: var(--accent-deep); text-decoration: none; }
.hero-links span { color: var(--line); margin: 0 8px; }

/* ============================================================
   v2.2: mobile breathing room
   ============================================================ */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .section-head { margin-bottom: 30px; }

  /* cards: slightly slimmer padding, roomier stacking */
  .door, .service, .contact-card, .project, .help-card, .method { padding: 22px 20px; }
  .doors, .services-grid, .projects-grid, .contact-grid { gap: 16px; }
  .help-grid, .method-grid { gap: 14px; }
  .shots, .shots.two { gap: 14px; }

  /* pipeline stepper: horizontal swipe instead of cramped wrapping */
  .pipeline {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 2px 12px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .pipeline li { flex: 0 0 auto; }

  /* timeline: reclaim horizontal space */
  .job { padding-left: 24px; }

  /* facts strip: tighter boxes when stacked */
  .facts > div { padding: 13px 16px; }

  /* buttons: generous tap targets, no side-by-side squeeze */
  .btn { padding: 13px 20px; }
  .btn-row .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.95rem; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; }
  .door .links { flex-direction: column; }
  .door .links .btn { width: 100%; justify-content: center; }
  .xp-head .btn { width: 100%; justify-content: center; }
  .hero-availability { font-size: 0.86rem; }
}
