:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --line: rgba(32, 30, 26, 0.08);
  --line-soft: rgba(32, 30, 26, 0.06);
  --text: #201e1a;
  --text-dim: #78716a;
  --text-faint: #a39c90;
  --accent: #2fb980;
  --accent-dim: #16875c;
  --accent-soft: rgba(47, 185, 128, 0.1);
  --shadow-sm: 0 1px 2px rgba(32, 30, 26, 0.05);
  --shadow-md: 0 16px 32px -20px rgba(32, 30, 26, 0.2);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #04140b; }

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

.label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
  color: var(--text);
}

p { color: var(--text-dim); text-wrap: pretty; max-width: 62ch; }

/* ---------- brand ---------- */
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: clamp(22px, 4vh, 34px);
}
.brand .mark {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand .tag {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
}
.brand .back {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
}
.brand .back:hover { color: var(--accent-dim); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 12vh, 132px) 0 clamp(48px, 8vh, 96px);
}

.hero-inner { max-width: 46rem; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.status-chip span:last-child {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--accent-dim);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.hero h1 .accent { color: var(--accent-dim); }

.hero .role {
  font-family: var(--mono);
  font-size: clamp(0.92rem, 1.4vw, 1.02rem);
  color: var(--text-dim);
}

.hero .role .sep { color: var(--text-faint); margin: 0 8px; }

.hero .pitch { font-size: 1.02rem; }

.cta-row { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }

.btn {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  background: var(--accent);
  color: #06170f;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 10px 24px -12px rgba(47, 185, 128, 0.45);
}
.btn.primary:hover { background: #33c988; }

.btn.ghost { color: var(--text); background: var(--surface); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- sections ---------- */
section { position: relative; z-index: 1; padding: clamp(48px, 8vh, 84px) 0; }
section + section { border-top: 1px solid var(--line-soft); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.01em; }
.section-head .count { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); }

/* about */
.about-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 6vw, 64px); align-items: start; }
.about-grid p { font-size: 1.05rem; }
.about-stats { display: grid; gap: 18px; font-family: var(--mono); min-width: 150px; }
.about-stats .stat b { display: block; font-size: 1.6rem; color: var(--accent-dim); }
.about-stats .stat span { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--text-faint); text-transform: uppercase; }

/* pricing */
.price-note { margin-top: -12px; margin-bottom: 30px; font-size: 0.95rem; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.price-card {
  border-radius: 12px;
  padding: 24px 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.price-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm), 0 20px 40px -18px rgba(47, 185, 128, 0.3);
}
.price-card h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.price-row:first-of-type { border-top: none; }
.price-row .model { color: var(--text-dim); }
.price-row .price { font-family: var(--mono); color: var(--text); white-space: nowrap; font-weight: 600; }

/* skills */
.skill-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-chip {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.skill-chip:hover { color: var(--accent-dim); background: var(--accent-soft); box-shadow: none; }

/* experience timeline */
.timeline { display: grid; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: clamp(16px, 4vw, 32px);
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
}
.tl-item:first-child { border-top: none; }
.tl-period { font-family: var(--mono); font-size: 0.8rem; color: var(--accent-dim); padding-top: 3px; font-weight: 600; }
.tl-role { font-size: 1.05rem; font-weight: 600; color: var(--text); font-family: var(--sans); }
.tl-org { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); margin: 4px 0 10px; }
.tl-desc { margin: 0; font-size: 0.95rem; }

/* projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.project-card {
  border-radius: 12px;
  padding: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm), 0 20px 40px -18px rgba(47, 185, 128, 0.3);
}
.project-card .index { font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint); }
.project-card h3 { font-size: 1.1rem; margin: 10px 0 8px; }
.project-card p { font-size: 0.9rem; margin: 0 0 16px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-row span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--text-dim); background: var(--line-soft); padding: 4px 10px; border-radius: 999px; }

/* case gallery */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.case-card {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-md);
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.case-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm), 0 20px 40px -18px rgba(47, 185, 128, 0.3);
}
.case-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; background: var(--line-soft); }
.case-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; }
.case-model { font-size: 0.86rem; font-weight: 500; color: var(--text); }
.case-date { display: flex; align-items: center; font-family: var(--mono); font-size: 0.74rem; color: var(--text-dim); white-space: nowrap; }
.case-date .dot, .lightbox-date .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 6px; }
.case-cta { display: flex; justify-content: center; margin-top: 28px; }
.case-intro { margin-bottom: 28px; }
.case-teaser { max-width: 640px; }
.case-teaser h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.01em; }
.case-teaser .case-cta { justify-content: flex-start; margin-top: 24px; }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 19, 16, 0.86);
}
.lightbox:not([hidden]) { display: flex; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(92vw, 560px); }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; border-radius: 10px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5); }
.lightbox figcaption { display: flex; align-items: center; gap: 14px; color: #f4f2ec; font-size: 0.9rem; }
.lightbox figcaption .lightbox-date { display: flex; align-items: center; font-family: var(--mono); font-size: 0.8rem; color: rgba(244, 242, 236, 0.7); }
.lightbox-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f2ec;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-btn svg { width: 20px; height: 20px; }
.lightbox-btn.close { top: 20px; right: 20px; }
.lightbox-btn.nav.prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-btn.nav.next { right: 20px; top: 50%; transform: translateY(-50%); }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(24px, 6vw, 56px); align-items: end; }
.contact-grid h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.15; }
.contact-list { display: grid; gap: 2px; }
.contact-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.96rem;
  color: var(--text);
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.contact-list a:hover { color: var(--accent-dim); padding-left: 10px; }
.contact-list a .k { color: var(--text-faint); font-size: 0.78rem; }
.contact-list .c-left { display: flex; align-items: center; gap: 12px; }
.contact-list .icon { width: 18px; height: 18px; flex-shrink: 0; }

/* location */
.map-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 6vw, 56px);
  align-items: start;
}
.map-grid h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.15; }
.addr-list { margin-top: 22px; }
.addr-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.86rem;
}
.addr-row:first-child { border-top: none; }
.addr-row .k {
  color: var(--text-faint);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.addr-row .v { color: var(--text); text-align: right; }
.map-note { margin-top: 22px; font-size: 0.88rem; }

footer {
  position: relative; z-index: 1;
  padding: 26px clamp(20px, 5vw, 48px) 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint);
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-stats { grid-auto-flow: column; grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: 4px; }
  .map-grid { grid-template-columns: 1fr; }
}

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