/* Page colors per tab: change these to restyle each page */
:root {
  --home: #f1ede2;    /* warm cream */
  --work: #f1ede2;    /* color 2 */
  --about: #f1ede2;   /* color 3 */
  --contact: #f1ede2; /* color 4 */

  --outside: #f7f5ef; /* around the frame */
  --ink: #1c1c1a;
  --line: 1.5px;
  --radius: 18px;

  /* Pill tab colors */
  --pill-line: #8f8c84;
  --pill-text: #4a4843;
  --pill-active: #fbfaf6;
}

/* ---------- Dark mode: on when the switch is checked ---------- */
:root:has(#mode:checked) {
  --home: #1f1e1b;
  --work: #1f1e1b;
  --about: #1f1e1b;
  --contact: #1f1e1b;

  --outside: #141412;
  --ink: #ece8dd;
  --pill-line: #6f6c65;
  --pill-text: #c9c5ba;
  --pill-active: #2c2b27;
  color-scheme: dark;
}

* { box-sizing: border-box; min-width: 0; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--outside);
  color: var(--ink);
  font: 15px/1.5 "Inter", "Helvetica Neue", Arial, sans-serif;
  transition: background 0.25s, color 0.25s;
}

input[name="tab"],
#mode { position: absolute; opacity: 0; pointer-events: none; }

/* The active radio sets the page color for the whole frame */
.site { --page: var(--home); }
#tab-work:checked    ~ .site { --page: var(--work); }
#tab-about:checked   ~ .site { --page: var(--about); }
#tab-contact:checked ~ .site { --page: var(--contact); }

.site {
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.frame {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- Top edge: folder tab + slanted step + pill nav ---------- */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  height: 44px;
}

.folder {
  flex: 0 0 auto;
  width: min(40vw, 480px);
  height: 64px;             /* reaches below the frame line to hide it */
  margin-bottom: -20px;
  border: var(--line) solid var(--ink);
  border-right: 0;
  border-bottom: 0;
  border-radius: var(--radius) 0 0 0;
  background: var(--page);
  transition: background 0.25s;
}

.logo {
  padding: 18px 0 0 22px;
  font: 400 26px/1 "Newsreader", Georgia, serif;
  letter-spacing: -0.01em;
}

.notch { flex: 0 0 48px; display: block; overflow: visible; }
.notch .fill { fill: var(--page); transition: fill 0.25s; }
.notch .line { fill: none; stroke: var(--ink); stroke-width: 1.5; }

.tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  height: 30px;
  margin-top: 0;
  padding-left: 12px;
  white-space: nowrap;
}

.tab {
  flex: none;
  padding: 4px 11px;
  border: 1px solid var(--pill-line);
  border-radius: 7px;
  font-size: 14px;
  color: var(--pill-text);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.tab:hover { border-color: var(--ink); color: var(--ink); }

/* Active pill: darker outline, light fill */
#tab-home:checked    ~ .site .tab.home,
#tab-work:checked    ~ .site .tab.work,
#tab-about:checked   ~ .site .tab.about,
#tab-contact:checked ~ .site .tab.contact {
  border: var(--line) solid var(--ink);
  background: var(--pill-active);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--ink);
}

#tab-home:focus-visible    ~ .site .tab.home,
#tab-work:focus-visible    ~ .site .tab.work,
#tab-about:focus-visible   ~ .site .tab.about,
#tab-contact:focus-visible ~ .site .tab.contact {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Light / dark switch */
.mode {
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin-left: 12px;
  border-radius: 13px;
  background: var(--ink);
  cursor: pointer;
  transition: background 0.25s;
}
/* The knob: a sun (full circle) in light mode, a moon (crescent) in dark */
.mode::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--outside);
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
#mode:checked ~ .site .mode::before {
  transform: translateX(20px);
  background: transparent;
  box-shadow: inset -6px -2px 0 0 var(--outside);
}
#mode:focus-visible ~ .site .mode {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Page body inside the frame ---------- */
.pages {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  margin-top: calc(-1 * var(--line));
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  background: var(--page);
  transition: background 0.25s;
}

.page { display: none; flex: 1; padding: 48px; }

#tab-home:checked    ~ .site .page.home,
#tab-work:checked    ~ .site .page.work,
#tab-about:checked   ~ .site .page.about,
#tab-contact:checked ~ .site .page.contact {
  display: block;
}

@media (max-width: 720px) {
  .site { padding: 12px; }
  .folder { width: 104px; }
  .logo { padding: 14px 0 0 14px; font-size: 16px; }
  .tabs { gap: 5px; padding-left: 4px; overflow-x: auto; }
  .tab { padding: 3px 7px; font-size: 12px; }
  .mode { margin-left: 4px; }
}

@media (max-width: 440px) {
  .tabs { justify-content: flex-start; }
  /* keep the switch visible while the tabs scroll */
  .mode { position: sticky; right: 0; box-shadow: -10px 0 0 4px var(--outside); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Screen-reader-only text */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =========================================================
   Content
   ========================================================= */
:root {
  --accent: #924246;     /* accent color */
  --on-accent: #fbf6f1;  /* text on the accent color */
  --highlight: #e3b1b3;  /* "selection" behind the headline: light tint of the accent */
  --on-highlight: #1c1c1a; /* black text on it */
  --caret: #b85c61;      /* blinking cursor, a lighter shade of the accent */
  --muted: #6b6860;
  --card: #f8f6ef;
}
:root:has(#mode:checked) {
  --caret: #d68a8e;
  --highlight: var(--accent);      /* full accent in dark mode */
  --on-highlight: var(--on-accent); /* with light text */
  --muted: #a5a197;
  --card: #282723;
}

/* ---------- Home ---------- */
.page.home { padding: clamp(40px, 9vh, 110px) clamp(22px, 7vw, 110px); }

.intro { max-width: 680px; }

h1 {
  margin: 0 0 36px;
  font: 400 clamp(38px, 6vw, 68px)/1.08 "Newsreader", Georgia, serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Fake text selection: a teal block behind the words */
.hl {
  background: var(--highlight);
  color: var(--on-highlight);
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;  /* keeps the block neat when it wraps */
}

/* Fake text cursor after the headline */
h1::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.9em;
  margin-left: 4px;
  vertical-align: -0.1em;
  background: var(--caret);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.intro p {
  margin: 0 0 28px;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.65;
}
.intro .lead { font-size: 19px; }

.cta { margin-top: 32px !important; }
.cta-link {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.cta-link:hover { background: var(--highlight); color: var(--on-highlight); text-decoration: none; }

/* ---------- Work ---------- */
.page.work { padding: clamp(40px, 9vh, 110px) clamp(22px, 7vw, 110px); }

h2 {
  margin: 0 0 28px;
  font: 400 clamp(32px, 4vw, 44px)/1.1 "Newsreader", Georgia, serif;
  letter-spacing: -0.01em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  padding: 22px;
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover,
.card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 4px 4px 0 var(--accent);
  outline: none;
}

.kind {
  align-self: flex-start;
  padding: 2px 9px;
  border: 1px solid var(--pill-line);
  border-radius: 7px;
  font-size: 13px;
  color: var(--pill-text);
}

.card .title {
  font: 400 26px/1.15 "Newsreader", Georgia, serif;
  letter-spacing: -0.01em;
}

/* the url sits at the bottom of the card */
.card .url {
  margin-top: auto;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.card:hover .url { color: var(--accent); }
:root:has(#mode:checked) .card:hover .url { color: var(--caret); }

.card .summary {
  font-size: 15px;
  line-height: 1.55;
  color: var(--pill-text);
}

@media (max-width: 720px) {
  .intro p, .intro .lead { font-size: 16px; }
  .card .title { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  h1::after { animation: none; }
}

/* ---------- About Me ---------- */
.page.about { padding: clamp(40px, 9vh, 110px) clamp(22px, 7vw, 110px); }

.about-intro { max-width: 680px; margin-bottom: 48px; }
.about-intro p { margin: 0 0 16px; font-size: 17px; line-height: 1.65; }
.about-intro .lead { font-size: 19px; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.side { display: grid; gap: 40px; }

h3 {
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: var(--line) solid var(--ink);
  font: 400 26px/1.1 "Newsreader", Georgia, serif;
}

.timeline, .edu, .skills { list-style: none; margin: 0; padding: 0; }

/* Experience: dots on a thin line */
.timeline li {
  position: relative;
  padding: 0 0 28px 24px;
  border-left: 1px solid var(--pill-line);
  margin-left: 5px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: var(--line) solid var(--ink);
  background: var(--page);
}
.timeline li:first-child::before { background: var(--accent); border-color: var(--accent); }

.when, .role, .org { display: block; }
.when { font-size: 13px; color: var(--muted); }
.role { margin: 2px 0; font: 400 21px/1.25 "Newsreader", Georgia, serif; }
.org { font-size: 14px; color: var(--pill-text); }
.timeline p { margin: 8px 0 0; max-width: 58ch; font-size: 15px; line-height: 1.6; }

.grade {
  padding: 0 5px;
  background: var(--highlight);
  color: var(--on-highlight);
  font-weight: 500;
}

.edu li { padding: 0 0 18px; }
.edu li:last-child { padding-bottom: 0; }
.edu .role { font-size: 19px; }

.skills { display: flex; flex-wrap: wrap; gap: 8px; }
.skills li {
  padding: 4px 11px;
  border: 1px solid var(--pill-line);
  border-radius: 7px;
  font-size: 14px;
  color: var(--pill-text);
}

@media (max-width: 820px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .about-intro p, .about-intro .lead { font-size: 16px; }
}

/* ---------- Contact ---------- */
.page.contact { padding: clamp(40px, 9vh, 110px) clamp(22px, 7vw, 110px); }

.contact-wrap { max-width: 680px; }
.contact-wrap .lead { margin: 0 0 28px; font-size: 19px; line-height: 1.65; }

/* Big email address, highlighted on hover like the headline */
.email {
  display: inline-block;
  margin-bottom: 44px;
  padding: 0 0.08em;
  font: 400 clamp(26px, 4.4vw, 44px)/1.15 "Newsreader", Georgia, serif;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}
.email:hover,
.email:focus-visible {
  background: var(--highlight);
  color: var(--on-highlight);
  text-decoration: none;
  outline: none;
}

.socials {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: var(--line) solid var(--ink);
}
.socials a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--pill-line);
  color: var(--ink);
  text-decoration: none;
  transition: padding 0.2s, color 0.2s;
}
.socials .net { font: 400 24px/1.2 "Newsreader", Georgia, serif; }
.socials .handle { flex: 1; font-size: 14px; color: var(--muted); }
.socials .arrow { font-size: 18px; transition: transform 0.2s; }

.socials a:hover,
.socials a:focus-visible { padding-left: 12px; color: var(--accent); outline: none; }
:root:has(#mode:checked) .socials a:hover,
:root:has(#mode:checked) .socials a:focus-visible { color: var(--caret); }
.socials a:hover .arrow { transform: translate(3px, -3px); }

@media (max-width: 720px) {
  .contact-wrap .lead { font-size: 16px; }
  .socials .net { font-size: 20px; }
}

/* ---------- Photos ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  max-width: 1160px;
}

/* Photo with a thin outline and an accent shadow, tilted a little */
.portrait,
.photo {
  margin: 0;
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}
.portrait img,
.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait {
  aspect-ratio: 4 / 5;
  transform: rotate(2deg);
  box-shadow: 8px 8px 0 var(--highlight);
}

.photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 760px;
  margin: -8px 0 56px;
}
.photo {
  aspect-ratio: 4 / 5;
  transition: transform 0.25s, box-shadow 0.25s;
}
.photo:nth-child(1) { transform: rotate(-2deg); }
.photo:nth-child(2) { transform: rotate(1.5deg) translateY(10px); }
.photo:nth-child(3) { transform: rotate(-1deg); }
.photo:nth-child(3) img { object-position: center 60%; }
.page.about .portrait img { object-position: center 62%; }  /* focus on Lynn signing */
.page.about .hero { margin-bottom: 56px; }
.page.about .about-intro { margin-bottom: 0; }
.photo:hover {
  transform: rotate(0) translateY(-4px);
  box-shadow: 6px 6px 0 var(--highlight);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .portrait { order: -1; width: min(200px, 60%); }
}
@media (max-width: 600px) {
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .photo { border-radius: 10px; }
}
