/* Belma Herenda — Editorial Engineering Portfolio
   A human, confident, editorial design system with bespoke typography and calm restraint.
   No AI gradients, no glowing blobs, no generic SaaS tropes. */

:root {
  color-scheme: light;
  --paper: #f8f7f4;
  --card: #ffffff;
  --surface: #f1efe9;
  --surface-hover: #eae7df;
  --ink: #181715;
  --body: #3c3a36;
  --muted: #6e6a62;
  --faint: #a6a297;
  --border: #e2ded5;
  --border-light: #ece9e2;
  --accent: #194336;          /* Deep alpine spruce */
  --accent-hover: #102e25;
  --accent-tint: #eaf1ed;
  --footer-bg: #151412;
  --footer-fg: #f5f3ec;
  --footer-muted: #9c978b;
  --footer-border: #2a2824;
  
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131211;
  --card: #1c1b18;
  --surface: #22201d;
  --surface-hover: #292723;
  --ink: #f2eee3;
  --body: #c7c2b5;
  --muted: #969183;
  --faint: #5e5b52;
  --border: #2c2a26;
  --border-light: #24221f;
  --accent: #78a994;
  --accent-hover: #96c4af;
  --accent-tint: rgba(120, 169, 148, 0.12);
  --footer-bg: #0d0c0b;
  --footer-fg: #f2eee3;
  --footer-muted: #8c877b;
  --footer-border: #201e1b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #131211;
    --card: #1c1b18;
    --surface: #22201d;
    --surface-hover: #292723;
    --ink: #f2eee3;
    --body: #c7c2b5;
    --muted: #969183;
    --faint: #5e5b52;
    --border: #2c2a26;
    --border-light: #24221f;
    --accent: #78a994;
    --accent-hover: #96c4af;
    --accent-tint: rgba(120, 169, 148, 0.12);
    --footer-bg: #0d0c0b;
    --footer-fg: #f2eee3;
    --footer-muted: #8c877b;
    --footer-border: #201e1b;
  }
}

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

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

body {
  background-color: var(--paper);
  color: var(--body);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

body.overlay-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

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

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 10px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-cv-link {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  background: var(--ink);
  color: var(--paper) !important;
  border-radius: 4px;
  transition: opacity 0.15s ease;
}

.nav-cv-link:hover {
  opacity: 0.88;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--muted);
}

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* Hero Section */
.hero {
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 56px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kicker {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--body);
  line-height: 1.6;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
  font-family: var(--font-sans);
}

.btn-editorial {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--paper) !important;
  border-radius: 4px;
  transition: opacity 0.15s ease;
}

.btn-editorial:hover {
  opacity: 0.88;
}

.link-editorial {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-editorial:hover {
  text-decoration: underline;
}

/* Hero Portrait */
.hero-photo-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(24, 23, 21, 0.08);
}

.hero-photo-caption {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}

/* Credential Strip */
.credentials-bar {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.credentials-wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.credential-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.credential-item:last-child {
  border-right: none;
  padding-right: 0;
}

.cred-number {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}

.cred-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.cred-sub {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Sections */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin-bottom: 40px;
}

.section-kicker {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-lede {
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 8px;
  max-width: 640px;
}

/* Selected Work / Articles */
.case-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.case-row {
  display: grid;
  grid-template-columns: 80px 1fr 180px;
  align-items: baseline;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  transition: background-color 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.case-row:first-child {
  border-top: 1px solid var(--border);
}

.case-row:hover .case-title {
  color: var(--accent);
}

.case-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.case-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-domain {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.case-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
  transition: color 0.15s ease;
}

.case-summary {
  font-size: 0.98rem;
  color: var(--body);
  line-height: 1.6;
}

.case-side {
  text-align: right;
  font-family: var(--font-sans);
}

.case-metric {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}

.case-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

/* Timeline / Career */
.timeline-entries {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
}

.timeline-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-company-name {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.timeline-loc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--muted);
}

.timeline-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-role-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
}

.timeline-points {
  padding-left: 18px;
  list-style: disc;
}

.timeline-points li {
  font-size: 0.98rem;
  color: var(--body);
  line-height: 1.6;
  margin-bottom: 6px;
}

.timeline-points li strong {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 600;
}

/* Testimonials / Quotes */
.quotes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.quote-block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 32px;
}

.quote-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.6;
}

.quote-author {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.quote-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.quote-info {
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
}

.quote-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.quote-role {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Skills / Foundations */
.skills-editorial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.skills-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-col-head {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.skills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skills-list li {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--body);
}

.skills-list li strong {
  color: var(--ink);
}

/* CV Banner / Callout */
.cv-callout {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.cv-callout-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 40px;
}

.cv-callout-copy h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.cv-callout-copy p {
  font-size: 1.02rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 64px 0 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-lead {
  max-width: 420px;
}

.footer-lead h4 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--footer-fg);
  margin-bottom: 8px;
}

.footer-lead p {
  font-size: 0.95rem;
  color: var(--footer-muted);
  line-height: 1.6;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-sans);
}

.footer-links-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--footer-muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--footer-fg);
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-sub {
  border-top: 1px solid var(--footer-border);
  padding-top: 24px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--footer-muted);
  display: flex;
  justify-content: space-between;
}

/* Modal Overlay for Case Studies */
.case-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 17, 16, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.case-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.case-dialog {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.2s ease;
  padding: 44px;
}

.case-overlay.open .case-dialog {
  transform: translateY(0);
}

.case-close {
  position: sticky;
  top: 0;
  float: right;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  margin-top: -12px;
  margin-right: -12px;
}

.case-close:hover {
  border-color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-photo-frame {
    margin: 0;
    max-width: 260px;
  }
  .credentials-wrap {
    grid-template-columns: repeat(2, 1fr);
  }
  .credential-item:nth-child(2) {
    border-right: none;
  }
  .case-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .case-side {
    text-align: left;
  }
  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .quotes-grid {
    grid-template-columns: 1fr;
  }
  .skills-editorial-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cv-callout-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .site-nav .nav-links {
    display: none;
  }
  .credentials-wrap {
    grid-template-columns: 1fr;
  }
  .credential-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
  }
  .credential-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .footer-inner {
    flex-direction: column;
  }
}
