/* therachelchen.com — site styles (light theme only, never dark backgrounds) */

:root {
  color-scheme: light;

  /* "Seattle sunset" palette */
  --bg: #fdf8fa;
  --surface: #ffffff;
  --text: #2a2030;
  --muted: #6a5f72;
  --line: #eee2ea;
  --accent: #a8326e;        /* links + buttons */
  --accent-strong: #861f55;

  --sky: #cfe6f5;
  --lavender: #dcd6f7;
  --pink: #f9d6e4;
  --peach: #fbe3d6;

  /* lighter tints for card backgrounds, darker inks for text on the pastels */
  --sky-tint: #edf5fb;
  --lavender-tint: #f1effc;
  --pink-tint: #fdf0f5;
  --peach-tint: #fef3ec;
  --sky-ink: #1f5578;
  --lavender-ink: #4f37a3;
  --pink-ink: #861f55;
  --peach-ink: #7a3a1c;

  /* Fonts: Newsreader for reading text, Fraunces (with its SOFT axis) for the
     wordmark and headings. Both are loaded by the Google Fonts <link> in each page's <head>. */
  --font: "Newsreader", Georgia, "Times New Roman", serif;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --head-soft: "SOFT" 100, "WONK" 0;

  --wrap: 1080px;
  --measure: 42rem;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 32, 48, .04), 0 8px 24px rgba(42, 32, 48, .05);
  --header-h: 4.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-head); font-variation-settings: var(--head-soft); line-height: 1.2; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.2rem); margin: 0 0 .5rem; font-weight: 600; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; font-weight: 600; }
h3 { font-size: 1.2rem; margin: 2rem 0 .75rem; font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: var(--measure); }

.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 20;
  background: var(--surface); padding: .5rem .75rem; border-radius: 8px;
}
.skip-link:focus { left: .5rem; }

/* ---------- Header (stays at the top while scrolling) ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(253, 248, 250, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .4rem 1.5rem;
  min-height: var(--header-h); padding-top: .55rem; padding-bottom: .55rem;
}

.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; }

.wordmark {
  font-family: var(--font-head);
  font-variation-settings: var(--head-soft);
  font-weight: 600;
  font-size: 1.1rem;          /* the smaller letters (~0.78 of the caps) */
  letter-spacing: .07em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark .cap { font-size: 1.28em; }   /* R and C: 1 / 0.78 */

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .15rem 1.35rem;
}
.site-nav a {
  display: block; padding: .3rem 0;
  font-size: .98rem; color: var(--text); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-strong); border-bottom-color: var(--pink); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Main ---------- */

main { padding: 2.75rem 0 4.5rem; }

.page-head { margin-bottom: 2.25rem; }
.page-head h1 { margin-bottom: .35rem; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }

.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose li { margin-bottom: .4em; }
.prose strong { font-weight: 600; }
.prose > :last-child { margin-bottom: 0; }

.button {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font); font-size: .92rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; padding: .55rem 1rem; border-radius: 999px;
  border: 1px solid #e3d3de; background: var(--surface); color: var(--text);
}
.button:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.button svg { width: 1.05em; height: 1.05em; flex: none; }
.button.small { font-size: .85rem; padding: .4rem .8rem; }

.badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 500; line-height: 1.5;
  background: var(--pink); color: var(--pink-ink); text-decoration: none;
}
a.badge:hover { color: var(--pink-ink); text-decoration: underline; }
.badge.award { background: var(--lavender); color: var(--lavender-ink); }
.badge.date { background: var(--sky); color: var(--sky-ink); }
.badge.event { background: var(--peach); color: var(--peach-ink); }
.badge.status { background: var(--surface); color: var(--accent-strong); border: 1px solid var(--pink); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; font-size: .9rem; color: var(--muted); }

/* ---------- Homepage intro ---------- */

.intro {
  display: flex; align-items: center; gap: 1.5rem 2rem;
  padding: 1.5rem 0 1rem;
}
.portrait {
  flex: none; width: 168px; height: 168px; border-radius: 50%;
  object-fit: cover; box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--pink), var(--shadow);
}
.intro h1 { margin: 0 0 1rem; line-height: 1; }
.intro .wordmark { font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.75rem); font-weight: 600; letter-spacing: .06em; white-space: normal; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }

/* ---------- Homepage sections ---------- */

.section { margin-top: 4rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem); }
.section-head a { font-size: .95rem; }
.sub-head { font-size: 1.05rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 2.75rem 0 1rem; }

.about-brief { max-width: var(--measure); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.tags li { padding: .3rem .85rem; border-radius: 10px; font-size: .92rem; border: 1px solid rgba(42, 32, 48, .06); }
.tags li:nth-child(4n+1) { background: var(--sky); color: var(--sky-ink); }
.tags li:nth-child(4n+2) { background: var(--lavender); color: var(--lavender-ink); }
.tags li:nth-child(4n+3) { background: var(--pink); color: var(--pink-ink); }
.tags li:nth-child(4n+4) { background: var(--peach); color: var(--peach-ink); }

/* ---------- Expandable cards (projects, experience) ---------- */

.card-grid {
  display: grid; gap: 1.1rem; align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  --card-bg: var(--sky-tint); --card-edge: var(--sky);
  background: var(--card-bg);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.3rem 1.2rem;
  min-width: 0;
}
.card-grid > .card:nth-child(4n+2) { --card-bg: var(--lavender-tint); --card-edge: var(--lavender); }
.card-grid > .card:nth-child(4n+3) { --card-bg: var(--pink-tint); --card-edge: var(--pink); }
.card-grid > .card:nth-child(4n+4) { --card-bg: var(--peach-tint); --card-edge: var(--peach); }

.card summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: start;
  list-style: none; cursor: pointer; border-radius: 10px;
}
.card summary::-webkit-details-marker { display: none; }
.card summary::marker { content: ""; }
.card-title { grid-column: 1; margin: 0; font-size: 1.22rem; line-height: 1.3; }
.card-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: .35rem .4rem; }
.toggle {
  grid-column: 2; grid-row: 1 / span 2;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--card-edge);
  display: grid; place-items: center; color: var(--accent);
}
.toggle::before {
  content: ""; width: .5rem; height: .5rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .2s ease;
}
details[open] > summary .toggle::before { transform: translateY(2px) rotate(-135deg); }
.card summary:hover .toggle { border-color: var(--accent); }
.card summary:hover .card-title { color: var(--accent-strong); }

.card-body { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--card-edge); font-size: 1.0625rem; line-height: 1.65; }
.card-body .note { font-size: .95rem; color: var(--muted); font-style: italic; }

/* Reserved area for screenshots / videos. Hidden until it has content. */
.card-media { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-top: 1rem; }
.card-media:empty { display: none; }
.card-media img, .card-media video { width: 100%; border-radius: 10px; }

.card-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.card-actions:empty { display: none; }

.card.plain { padding: 1.2rem 1.35rem; }
.card.plain h3, .card.plain h2 { margin: 0 0 .35rem; font-size: 1.22rem; }
.card.plain p { margin: 0; }

.placeholder { color: var(--muted); font-style: italic; margin: 0; }

/* Larger cards on /projects/ and /experience/ */
.page-cards .card-grid { gap: 1.35rem; }
.page-cards .card { padding: 1.45rem 1.65rem 1.5rem; }
.page-cards .card-title, .page-cards .card.plain h2 { font-size: 1.45rem; }
.page-cards .card-body { font-size: 1.125rem; }
.page-cards .badge { font-size: .85rem; }

/* ---------- Galleries & figures ---------- */

figure { margin: 1.75rem 0; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.figure-single img { border-radius: var(--radius); }
.figure-narrow { max-width: 28rem; }

.gallery {
  list-style: none; padding: 0; margin: 1.5rem 0 2.5rem;
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
}
.gallery li, .gallery figure { margin: 0; }
.gallery a { display: block; border-radius: 10px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.03); }
.gallery-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.gallery-2 img { aspect-ratio: 1 / 1; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 760px) { .contact-grid { grid-template-columns: 1fr 1.1fr; } }
.contact-grid img { border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-grid figure { margin: 0; }
.contact-grid .contact-buttons { margin-top: 1.5rem; }

/* ---------- Writing list ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list h2 { margin: .4rem 0 .35rem; font-size: 1.3rem; line-height: 1.3; }
.post-list h2 a { color: var(--text); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent-strong); text-decoration: underline; }
.post-list p {
  margin: 0; color: #4a4150;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

/* ---------- Single post ---------- */

.post { max-width: var(--measure); margin: 0 auto; }
.post-head { margin-bottom: 2rem; }
.post-head h1 { font-size: clamp(1.8rem, 1.35rem + 1.9vw, 2.5rem); margin-top: .7rem; line-height: 1.2; }
.post-body { font-size: 1.1875rem; line-height: 1.75; }
.post-body img { border-radius: 10px; }
.post-body figure > img { margin: 0 auto; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.post-body table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: .95rem; line-height: 1.55; background: var(--surface); }
.post-body td { border: 1px solid var(--line); padding: .65rem .75rem; vertical-align: top; }
.post-body tr:first-child td { background: var(--pink); }
.post-body td img { max-width: 9rem; margin-top: .4rem; }

.post-nav { display: grid; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a { text-decoration: none; display: block; }
.post-nav small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.post-nav span { font-weight: 600; }
.post-nav .next { text-align: right; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: .92rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-strong); }

/* ---------- Smaller screens ---------- */

@media (max-width: 820px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  :root { --header-h: 5.5rem; }
  body { font-size: 1.0625rem; }
  .wrap { padding: 0 1rem; }
  .site-header .wrap { gap: .2rem 1rem; padding-top: .5rem; padding-bottom: .4rem; }
  .brand img { width: 26px; height: 26px; }
  .wordmark { font-size: 1rem; }
  .site-nav { width: 100%; }
  .site-nav ul { gap: 0 .9rem; }
  .site-nav a { font-size: .88rem; padding: .15rem 0; }
  main { padding-top: 1.75rem; }
  .intro { gap: 1rem 1.15rem; padding-top: .5rem; }
  .portrait { width: 96px; height: 96px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--pink); }
  .intro h1 { margin-bottom: .75rem; }
  .section { margin-top: 3rem; }
  .card, .page-cards .card { padding: 1rem 1.05rem 1.1rem; }
  .card-title, .page-cards .card-title { font-size: 1.12rem; }
  .card-body, .page-cards .card-body { font-size: 1.0625rem; }
  .post-body { font-size: 1.125rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 460px) {
  :root { --header-h: 4.5rem; }
  .intro { flex-direction: column; align-items: flex-start; }
  /* all six nav words on one line at phone width */
  .site-nav ul { flex-wrap: nowrap; justify-content: space-between; gap: 0 .4rem; }
  .site-nav a { font-size: .82rem; }
}
@media (max-width: 345px) {
  .site-nav ul { flex-wrap: wrap; justify-content: flex-start; gap: 0 .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery img, .toggle::before { transition: none; }
}
