/* jpsa.online — editorial, paper & ink */

:root {
  --bg: #ffffff;
  --fg: #17171a;
  --muted: #6b6b73;
  --line: #e6e6ea;
  --accent: #c2410c;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --container: 1120px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #111113;
  --fg: #f2f2f4;
  --muted: #9d9da6;
  --line: #2a2a2f;
  --accent: #f0864f;
  color-scheme: dark;
}

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

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

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--bg); }

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

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

.link {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .15s, color .15s;
}
.link:hover { text-decoration-color: currentColor; color: var(--accent); }
.link-strong { color: var(--accent); text-decoration-color: currentColor; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav-container { display: flex; align-items: center; gap: 32px; height: 60px; }

.brand { font-family: var(--serif); font-size: 1.35rem; white-space: nowrap; }
.brand em { color: var(--accent); }

.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: .9rem; }
.nav-link { color: var(--muted); transition: color .15s; }
.nav-link:hover, .nav-link.active { color: var(--fg); }

.nav-actions { display: flex; align-items: center; gap: 16px; }

.lang-switch { display: flex; font-family: var(--mono); font-size: .75rem; }
.lang-btn { padding: 4px 5px; color: var(--muted); }
.lang-btn + .lang-btn::before { content: "/"; margin-right: 10px; color: var(--line); }
.lang-btn.active { color: var(--fg); }

.theme-toggle-btn { display: flex; color: var(--muted); }
.theme-toggle-btn:hover { color: var(--fg); }
.theme-toggle-btn svg { width: 17px; height: 17px; }

.mobile-menu-btn { display: none; }

/* Hero */

.hero { padding: 96px 0 88px; }

.hero-kicker {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 10vw, 8.5rem);
  line-height: .92;
  letter-spacing: -.02em;
  margin-bottom: 56px;
}
.hero-name em { color: var(--accent); }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--fg);
}

.hero-lead {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.2;
  max-width: 18em;
}

.hero-description { color: var(--muted); max-width: 34em; margin-bottom: 20px; }

.hero-links, .inline-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

.hero-meta { margin-top: 24px; font-size: .85rem; color: var(--muted); }

/* Sections */

.section { padding: 72px 0; }

.row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}

.row > *, .hero-grid > * { min-width: 0; }

.section .row { border-top: 1px solid var(--line); padding-top: 24px; }

.section-label {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-self: start;
  position: sticky;
  top: 84px;
}
.section-label .num { color: var(--accent); }

.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 40px;
}

/* Metrics */

.metrics { display: grid; grid-template-columns: repeat(2, 1fr); }

.metric {
  padding: 24px 24px 28px 0;
  border-top: 1px solid var(--line);
}
.metric:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--line); }

.metric-value {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 1;
  margin-bottom: 12px;
}

.metric dd { color: var(--muted); font-size: .92rem; max-width: 28em; }
.metric dd strong { display: block; color: var(--fg); font-weight: 500; }

/* Featured project */

.project { margin-bottom: 72px; }

.project-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.project-icon { width: 64px; height: 64px; border-radius: 14px; }

.project-name { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.1; }
.project-tagline { color: var(--muted); }

.project-status {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  align-self: start;
  text-align: right;
}

.project-desc { max-width: 42em; margin-bottom: 32px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 40px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 9 / 18;
  object-fit: cover;
  border-radius: 10px;
  background: var(--line);
}
.gallery figcaption { font-size: .78rem; color: var(--muted); margin-top: 8px; }

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  counter-reset: feat;
  margin-bottom: 28px;
}
.features li { padding: 16px 0; border-top: 1px solid var(--line); counter-increment: feat; }
.features h4 { font-weight: 500; margin-bottom: 4px; }
.features h4::before {
  content: counter(feat, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  margin-right: 10px;
}
.features p { font-size: .92rem; color: var(--muted); }

.stack { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin-bottom: 24px; }

.case { margin-top: 56px; }
.case .subsection-title { margin-bottom: 16px; }

/* Pacto apps */

.subsection-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.subsection-title { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; }

.subsection-desc { color: var(--muted); max-width: 42em; margin-bottom: 24px; }

.app-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.app-row:last-child { border-bottom: 1px solid var(--line); }
.app-row img { width: 44px; height: 44px; border-radius: 10px; }
.app-row h4 { font-weight: 500; }
.app-row span { font-size: .8rem; color: var(--muted); }
.app-row p { font-size: .9rem; color: var(--muted); }
.app-row .link { font-size: .85rem; white-space: nowrap; }

/* Entries (experience, education) */

.entry {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.entry-period { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding-top: 4px; }

.entry-role { font-size: 1.1rem; font-weight: 500; line-height: 1.35; }
.entry-org { color: var(--accent); font-size: .92rem; }
.entry-note { color: var(--muted); font-size: .85rem; margin-top: 2px; }

.entry-list { margin-top: 12px; max-width: 44em; }
.entry-list li { position: relative; padding-left: 20px; color: var(--muted); font-size: .95rem; }
.entry-list li + li { margin-top: 6px; }
.entry-list li::before { content: "–"; position: absolute; left: 0; }

/* Skills */

.skills > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.skills dt { font-weight: 500; }
.skills dd { color: var(--muted); }

/* Certs */

.certs-title { margin: 48px 0 12px; }
.certs li { padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }

/* Contact */

.contact-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1;
  margin-bottom: 20px;
}

.contact-subtitle { color: var(--muted); max-width: 36em; margin-bottom: 32px; }

.contact-email {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 24px;
}

.copy-btn {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 10px;
}
.copy-btn:hover, .copy-btn.copied { color: var(--fg); border-color: var(--fg); }

.site-footer {
  padding: 32px 0 48px;
  font-size: .8rem;
  color: var(--muted);
}

/* Responsive */

@media screen and (max-width: 900px) {
  .row, .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .section-label { position: static; }
  .app-row { grid-template-columns: 44px 1fr auto; }
  .app-row p { grid-column: 2 / -1; }
}

@media screen and (max-width: 760px) {
  .nav-container { gap: 16px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-actions { margin-left: auto; }
  .mobile-menu-btn { display: flex; }

  .hero { padding: 56px 0 48px; }
  .section { padding: 48px 0; }

  .metrics, .features { grid-template-columns: 1fr; }
  .metric:nth-child(even) { padding-left: 0; border-left: 0; }

  .project-head { grid-template-columns: auto 1fr; }
  .project-status { grid-column: 1 / -1; text-align: left; }

  .gallery { grid-template-columns: repeat(5, 150px); }

  .entry, .skills > div { grid-template-columns: 1fr; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
