/* ============================================================
   Charlotte Clark — portfolio
   Design tokens, base type system, components
   ============================================================ */

:root {
  /* Palette */
  --paper:     #FAFAF7;
  --paper-2:   #F2F1EC;
  --ink:       #0A0A0A;
  --ink-2:     #1F1F1F;
  --muted:     #6B6B6B;
  --hairline:  #E2E1DB;
  --blue:      #1D3FAA;
  --blue-hover:#152E80;

  /* Type */
  --serif: "Fraunces", "Times New Roman", Georgia, serif;
  --sans:  "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --max:        1120px;
  --gutter:     clamp(20px, 4vw, 40px);
  --section-y:  clamp(64px, 10vw, 120px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ---------- Type ---------- */
.serif      { font-family: var(--serif); }
.mono       { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }

h1 {
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

p { margin: 0 0 1em; }

em, i { font-style: italic; }

/* ---------- Layout primitives ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section + .section { padding-top: 0; }

.hairline {
  height: 1px;
  background: var(--hairline);
  border: 0;
  margin: 0;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__brand {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.01em;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav__brand::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--blue);
  display: inline-block;
  border-radius: 1px;
}
.nav__links {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}
.nav__links a {
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--blue);
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(56px, 9vw, 100px); }

.hero__grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.hero__name {
  margin-top: 18px;
}

.hero__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.25;
  color: var(--ink-2);
  margin-top: 22px;
  max-width: 28ch;
  letter-spacing: -0.01em;
}

.hero__photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  overflow: hidden;
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.hero__photo-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Right-column meta block under the photo */
.hero__currently {
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.hero__currently dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.hero__currently dd {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hero__currently dd em { font-style: italic; color: var(--ink-2); }
.hero__currently dd:last-child { margin-bottom: 0; }

/* Bio block — sits in left column under tagline */
.bio {
  max-width: 56ch;
  margin-top: clamp(36px, 5vw, 56px);
  font-size: clamp(16.5px, 1.5vw, 18px);
  line-height: 1.65;
  color: var(--ink-2);
}
.bio p + p { margin-top: 1.1em; }
.bio em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
  font-size: 1.03em;
  letter-spacing: -0.005em;
}

/* ---------- Section heading ---------- */
.sec-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  padding-bottom: 28px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--hairline);
}
.sec-head__title { display: flex; flex-direction: column; gap: 12px; }
.sec-head__count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Next-up cards (home) ---------- */
.next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hairline);
  border-block: 1px solid var(--hairline);
}
.next__card {
  background: var(--paper);
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background .2s ease;
}
.next__card:hover { background: var(--paper-2); }
.next__card .eyebrow { color: var(--blue); }
.next__card h3 { font-style: italic; }
.next__card p { color: var(--muted); margin: 0; max-width: 38ch; }
.next__card .arrow {
  font-family: var(--serif);
  font-size: 18px;
  margin-top: auto;
  color: var(--blue);
}

/* ---------- Project cards (tech) ---------- */
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 40px);
}
.proj {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--hairline);
  transition: border-color .2s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.proj:hover {
  border-color: var(--ink);
}
.proj:hover .proj__title { color: var(--blue); }

.proj__thumb {
  aspect-ratio: 16 / 10;
  background: var(--paper-2);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}
.proj__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.proj:hover .proj__thumb img { transform: scale(1.035); }

.proj__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(24px, 3vw, 36px);
}

.proj__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}
.proj__year {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.proj__title {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  transition: color .15s ease;
}
.proj__tagline {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-2);
  font-size: 17px;
  margin: 0 0 18px;
}
.proj__body {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 0 28px;
}
.proj__foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.proj__link { color: var(--blue); display: inline-flex; gap: 8px; align-items: center; }
.proj__link::after { content: "↗"; font-family: var(--serif); }

/* ---------- Volunteering focus list ---------- */
.focus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hairline);
  border-block: 1px solid var(--hairline);
}
.focus__item {
  background: var(--paper);
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.focus__item--full {
  grid-column: 1 / -1;
}
.focus__num {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--blue);
}
.focus__title {
  font-family: var(--serif);
  font-size: clamp(24px, 2.8vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.focus__body {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 40ch;
}

/* ---------- Partner / nonprofit logo strip ---------- */
.partners {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 5vw, 64px) clamp(48px, 7vw, 88px);
  padding: clamp(40px, 6vw, 64px) clamp(28px, 5vw, 48px);
  border: 1px solid var(--hairline);
  background: var(--paper);
}
.partners__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  flex: 0 0 auto;
}
.partners__cell img {
  max-height: 100%;
  max-width: 260px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ---------- Blog list ---------- */
.posts { border-top: 1px solid var(--hairline); }
.post {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 32px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  transition: padding-left .15s ease;
}
.post:hover { padding-left: 10px; }
.post:hover .post__title { color: var(--blue); }
.post__date {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.post__title {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  transition: color .15s ease;
}
.post__excerpt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin-top: 6px;
  max-width: 60ch;
}
.post__arrow {
  font-family: var(--serif);
  color: var(--blue);
  font-size: 18px;
}

.post-empty {
  padding: 40px 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
}

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--hairline);
  padding-block: 48px;
  margin-top: clamp(64px, 8vw, 100px);
}
.foot__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: lowercase;
}
.foot a:hover { color: var(--blue); }
.foot__links { display: flex; gap: 22px; }

/* ---------- Blog post page ---------- */
.post-page {
  max-width: 720px;
  padding-top: clamp(48px, 7vw, 80px);
  padding-bottom: clamp(48px, 7vw, 80px);
}
.post-page__back {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 32px;
  transition: color .15s ease;
}
.post-page__back:hover { color: var(--blue); }

.post-page__head { margin-bottom: 48px; }
.post-page__head .eyebrow { display: block; margin-bottom: 16px; }
.post-page__head h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
}

.post-body {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-2);
}
.post-body p { margin: 0 0 1.3em; }
.post-body h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3vw, 30px);
  color: var(--ink);
  margin: 2em 0 0.8em;
}
.post-body figure { margin: 2em 0; }
.post-body img { width: 100%; border: 1px solid var(--hairline); }
.post-body figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 0.04em;
}
.post-body ul { padding-left: 1.3em; margin: 0 0 1.3em; }
.post-body li { margin-bottom: 0.5em; }
.post-body blockquote {
  border-left: 2px solid var(--blue);
  padding-left: 24px;
  margin: 2em 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
}
.post-page__foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__photo { max-width: 380px; }
  .hero__currently { display: none; }
  .next, .focus { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .partners { grid-template-columns: repeat(2, 1fr); }
  .post {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .post__arrow { display: none; }
  .sec-head { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav__inner { padding: 14px var(--gutter); gap: 12px; }
  .nav__brand { font-size: 16px; white-space: nowrap; }
  .nav__brand::before { width: 7px; height: 7px; }
  .nav__links { gap: 14px; font-size: 11.5px; }
}

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

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}
