/* ==========================================================================
   Minimalist Editorial Portfolio — Inspired by Grace Wijaya Reference
   Clean, neat, to-the-point, dual light/dark theme, zero clutter.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --surface-thumb: #f2f4f7;
  --border: #eaecef;
  --border-strong: #d5dae1;
  --text: #111315;
  --text-secondary: #525860;
  --text-muted: #767d86;
  --highlight-bg: #fde68a;
  --highlight-text: #111315;
  --accent: #0f5c6e;
  --status-green: #22c55e;
  --radius-card: 14px;
  --radius-pill: 999px;
  --shadow-modal: 0 24px 64px rgba(17, 19, 21, 0.16);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0d0f12;
  --surface: #13161b;
  --surface-subtle: #1a1e25;
  --surface-thumb: #181c23;
  --border: #232832;
  --border-strong: #323946;
  --text: #f2f4f7;
  --text-secondary: #a4acb8;
  --text-muted: #7c8594;
  --highlight-bg: rgba(245, 196, 67, 0.22);
  --highlight-text: #fde68a;
  --accent: #4ec3d8;
  --status-green: #34d399;
  --shadow-modal: 0 28px 72px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
}

.icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- Top Utility Bar ---------- */
.topbar {
  width: 100%;
  padding: 20px 28px 0;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pill-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.lang-btn {
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.theme-switch {
  position: relative;
  width: 56px;
  height: 36px;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  display: inline-flex;
  align-items: center;
  transition: border-color 0.15s ease, background-color 0.2s ease;
}

.theme-switch:hover {
  border-color: var(--border-strong);
}

.theme-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transform: translateX(0);
  transition: transform 0.2s ease;
}

[data-theme="dark"] .theme-thumb {
  transform: translateX(20px);
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

/* ---------- Main Container & Centered Hero ---------- */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 44px 24px 80px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 72px;
}

.avatar-wrap {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 20px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.hero-name {
  margin: 0 0 14px;
  font-size: clamp(24px, 3.6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 20px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.hero-meta li,
.hero-meta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta a {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.hero-meta a:hover {
  color: var(--text);
}

/* ---------- 2-Column Editorial Resume Grid ---------- */
.sections {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.section-grid {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 24px 40px;
  align-items: start;
}

.section-label h2 {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* About */
.about-copy p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.72;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-copy mark {
  background: var(--highlight-bg);
  color: var(--highlight-text);
  font-weight: 500;
  padding: 1px 2px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------- Projects Filter & Grid ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-pill[aria-selected="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
  padding: 0;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-thumb);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.project-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.project-metric {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

.project-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---------- Experience, Organization & Education Cards ---------- */
.card-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 20px 22px;
}

.entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.entry-title {
  margin: 0 0 2px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.entry-org {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.entry-date {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.entry-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.entry-bullets {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.entry-bullets li::marker {
  color: var(--text-muted);
}

.earlier-wrap {
  margin-top: 14px;
}

.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.expand-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-subtle);
}

.expand-btn .chevron {
  transition: transform 0.2s ease;
}

.expand-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.earlier-stack {
  margin-top: 14px;
}

/* ---------- Skills (Grace Wijaya crisp bulleted layout) ---------- */
.skills-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skills-list li::marker {
  color: var(--text);
}

.skill-name {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.skill-desc {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- Contact ---------- */
.contact-rows {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
}

.contact-row dt {
  font-weight: 600;
  color: var(--text);
}

.contact-row dd {
  margin: 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-row a {
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.contact-row a:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

.copy-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.social-row {
  margin-top: 6px;
}

.social-circles {
  display: flex;
  gap: 10px;
}

.social-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.social-circle:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-subtle);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 76px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer p {
  margin: 0;
}

/* ---------- Project Case-Study Modal ---------- */
.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(13, 15, 18, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--surface-subtle);
}

.modal-thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-thumb);
  border-bottom: 1px solid var(--border);
}

.modal-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-body {
  padding: 22px 24px 26px;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-period {
  font-size: 12.5px;
  color: var(--text-muted);
}

.modal-highlight {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.modal-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-summary {
  margin: 0 0 14px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--text);
  color: var(--bg);
}

.modal-link.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.modal-link.secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
  opacity: 1;
}

.modal-link:hover {
  opacity: 0.88;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar {
    padding: 16px 18px 0;
  }

  .container {
    padding: 32px 18px 64px;
  }

  .hero {
    margin-bottom: 52px;
  }

  .sections {
    gap: 44px;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .entry-head {
    flex-direction: column;
    gap: 6px;
  }

  .contact-row {
    grid-template-columns: 76px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
