/* ==========================================================================
   pedramp.ca — design system
   Elegant editorial style. Fraunces for display, Inter for body.
   Themes are driven by [data-theme] on <html>.
   ========================================================================== */

:root {
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;

  --measure: 68ch;
  --container: 1120px;
  --radius: 6px;
  --radius-lg: 12px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms var(--ease);
  --t-slow: 500ms var(--ease);
}

/* Light theme (default) */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf8f3;
  --bg-raised: #ffffff;
  --bg-sunken: #f2efe7;
  --ink: #1c1b18;
  --ink-soft: #4c4a44;
  --ink-faint: #85817a;
  --line: #e2ddd2;
  --line-strong: #cfc9ba;
  --accent: #8a5a28;
  --accent-soft: #a97b45;
  --accent-wash: #f3ead9;
  --shadow: 0 1px 2px rgba(28, 27, 24, 0.05), 0 12px 32px -12px rgba(28, 27, 24, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14151a;
  --bg-raised: #1b1d23;
  --bg-sunken: #101116;
  --ink: #e9e6de;
  --ink-soft: #b5b1a6;
  --ink-faint: #7d796f;
  --line: #2a2c34;
  --line-strong: #3a3d47;
  --accent: #d8a95e;
  --accent-soft: #b98c47;
  --accent-wash: #262119;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14151a;
    --bg-raised: #1b1d23;
    --bg-sunken: #101116;
    --ink: #e9e6de;
    --ink-soft: #b5b1a6;
    --ink-faint: #7d796f;
    --line: #2a2c34;
    --line-strong: #3a3d47;
    --accent: #d8a95e;
    --accent-soft: #b98c47;
    --accent-wash: #262119;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  }
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-slow), color var(--t-slow);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--accent); color: var(--bg); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Layout ------------------------------------------------------------------ */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

main { display: block; }

.section {
  padding-block: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--line);
}
.section:first-of-type { border-top: none; }

/* Typography --------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 480;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}
.eyebrow::after {
  content: "";
  flex: 0 0 3rem;
  height: 1px;
  background: var(--line-strong);
  align-self: center;
}
.eyebrow .num {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.section-title {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  margin-bottom: 1.25rem;
  max-width: 24ch;
}

.lede {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* Justified body text with hyphenation to avoid rivers */
.prose p,
.lede,
.timeline p,
.note-body p,
.project p,
.card p,
.contact-card p,
.cta-band p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.prose { max-width: var(--measure); color: var(--ink-soft); }
.prose p + p { margin-top: 1.1rem; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast);
}
.prose a:hover { text-decoration-color: var(--accent); }

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--t-slow), border-color var(--t-slow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand .mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.brand:hover .mark { border-color: var(--accent); background: var(--accent-wash); }

.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  padding: 0.45rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 99px;
  white-space: nowrap;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.site-nav a:hover { color: var(--ink); background: var(--bg-sunken); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 0.6rem; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.lang-switch:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { width: 1.05rem; height: 1.05rem; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}

.nav-toggle { display: none; }

@media (max-width: 480px) {
  .brand { font-size: 1rem; gap: 0.55rem; }
  .brand .mark { width: 1.85rem; height: 1.85rem; font-size: 0.68rem; }
  .header-tools { gap: 0.45rem; }
  .lang-switch { padding: 0.3rem 0.65rem; }
  .theme-toggle, .nav-toggle { width: 2.15rem; height: 2.15rem; }
}

@media (max-width: 360px) {
  .brand-name { display: none; }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--ink-soft);
  }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.75rem clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.7rem 0.85rem; }
}

/* Hero ---------------------------------------------------------------------- */
.hero {
  padding-block: clamp(5rem, 12vw, 9rem) clamp(4.5rem, 10vw, 7.5rem);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -12%;
  width: 44rem;
  height: 44rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-wash), transparent 72%);
  opacity: 0.9;
  pointer-events: none;
}
.hero-inner { position: relative; }
.hero .kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  max-width: 15ch;
  margin-bottom: 1.75rem;
}
.hero h1 em {
  font-style: italic;
  font-weight: 420;
  color: var(--accent);
}
.hero .lede { margin-bottom: 2.5rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.hero-meta span strong {
  display: block;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* Buttons -------------------------------------------------------------------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 99px;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { color: #14151a; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.btn .arrow { transition: transform var(--t-fast); }
.btn:hover .arrow { transform: translateX(3px); }

/* Two-column section intro ---------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split .sticky-col { position: sticky; top: 6rem; }
@media (max-width: 860px) { .split .sticky-col { position: static; } }

/* Timeline --------------------------------------------------------------------- */
.timeline { list-style: none; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 2.75rem 2.25rem;
  border-left: 1px solid var(--line-strong);
}
.timeline li:last-child { padding-bottom: 0.5rem; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.55rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline .period {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.timeline h3 {
  font-size: 1.35rem;
  margin: 0.3rem 0 0.15rem;
}
.timeline .org { font-size: 0.95rem; color: var(--accent); font-weight: 550; margin-bottom: 0.7rem; }
.timeline p { color: var(--ink-soft); max-width: 58ch; }

/* Cards grid --------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.65rem;
}
.card .card-icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  color: var(--accent);
  background: var(--accent-wash);
  border-radius: var(--radius);
}
.card .card-icon svg { width: 1.25rem; height: 1.25rem; }
.card p { font-size: 0.95rem; color: var(--ink-soft); }
.card ul {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.card ul li {
  padding: 0.4rem 0;
  border-top: 1px dashed var(--line);
}
.card ul li:first-child { border-top: none; }

/* Chips ------------------------------------------------------------------------ */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.chip {
  font-size: 0.8rem;
  font-weight: 550;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--ink-soft);
  background: var(--bg-raised);
}

/* Credentials list ---------------------------------------------------------------- */
.cred-heading {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 2.75rem;
}
.cred-heading:first-child { margin-top: 0; }
.cred-list { list-style: none; padding: 0; margin-top: 0.5rem; }
.cred-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.cred-list li strong { font-weight: 600; color: var(--ink); }
.cred-list li span { color: var(--ink-faint); font-size: 0.85rem; white-space: nowrap; }

/* Notes / articles ------------------------------------------------------------------ */
.note-list { display: grid; gap: 1rem; margin-top: 3rem; }
.note {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast);
  overflow: hidden;
}
.note[open], .note:hover { border-color: var(--accent-soft); }
.note summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  cursor: pointer;
  list-style: none;
}
.note summary::-webkit-details-marker { display: none; }
.note .note-tag {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.note summary h3 { font-size: 1.25rem; }
.note .note-toggle {
  color: var(--ink-faint);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform var(--t-fast);
  align-self: center;
}
.note[open] .note-toggle { transform: rotate(45deg); color: var(--accent); }
.note .note-body {
  padding: 0 1.75rem 1.75rem;
  color: var(--ink-soft);
  max-width: 72ch;
}
.note .note-body p + p { margin-top: 1rem; }
@media (max-width: 640px) {
  .note summary { grid-template-columns: 1fr auto; }
  .note .note-tag { grid-column: 1 / -1; }
}

/* Project cards --------------------------------------------------------------------- */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.project:last-child { border-bottom: none; }
.project h3 { font-size: 1.45rem; margin-bottom: 0.6rem; }
.project p { color: var(--ink-soft); max-width: 62ch; }
.project .project-year {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* Gallery ------------------------------------------------------------------------------ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}
.gallery figure {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.gallery figure:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent-soft);
}
.gallery figure:nth-child(4n+1) { grid-row: span 1; }
.gallery .ph {
  aspect-ratio: 4 / 3;
  width: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}
.gallery figure img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}
.gallery .ph svg { width: 2rem; height: 2rem; opacity: 0.6; }
.gallery .ph-1 { background: linear-gradient(140deg, var(--accent-wash), var(--bg-sunken) 70%); }
.gallery .ph-2 { background: linear-gradient(220deg, var(--bg-sunken), var(--accent-wash) 85%); }
.gallery .ph-3 { background: linear-gradient(160deg, var(--bg-sunken) 20%, var(--accent-wash)); }
.gallery figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.gallery figcaption .loc { font-weight: 600; color: var(--ink); }
.gallery figcaption .year {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* Pull quote ------------------------------------------------------------------------ */
.pullquote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-style: italic;
  font-weight: 420;
  line-height: 1.4;
  max-width: 32ch;
  color: var(--ink);
  padding-left: 1.75rem;
  border-left: 2px solid var(--accent);
  margin-block: 3rem;
}

/* Contact ---------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}
.contact-card {
  display: block;
  text-decoration: none;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.contact-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.contact-card .label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
.contact-card .value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}
.contact-card p { font-size: 0.9rem; color: var(--ink-soft); }
.contact-card .go {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* CTA band ------------------------------------------------------------------------------ */
.cta-band {
  background: var(--bg-sunken);
  border-block: 1px solid var(--line);
  padding-block: clamp(3.5rem, 8vw, 6rem);
  text-align: center;
  transition: background-color var(--t-slow);
}
.cta-band h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  max-width: 22ch;
  margin-inline: auto;
  margin-bottom: 1rem;
}
.cta-band p {
  color: var(--ink-soft);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: 2.25rem;
}
.cta-band .btn-row { justify-content: center; }

/* Footer ---------------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
}
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-inner a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color var(--t-fast);
}
.footer-inner a:hover { color: var(--accent); }

/* Reveal animation -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  }
  .reveal.in { opacity: 1; transform: none; }
}

@media print {
  .site-header, .theme-toggle, .cta-band, .skip-link { display: none; }
}
