/* ---------------------------------------------------------
   Nina Serpiello — Design Research Portfolio
   --------------------------------------------------------- */

:root {
  --bg: #faf8f4;
  --bg-alt: #f1ece4;
  --ink: #201d19;
  --ink-soft: #5c574e;
  --ink-faint: #8a8377;
  --accent: #358d87;
  --accent-dark: #276863;
  --accent-tint: #ddeeed;
  --line: #e4dcd0;
  --white: #ffffff;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1180px;
  --measure: 700px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

p, li, figcaption, blockquote { text-wrap: pretty; }
.case-header h1, .case-header .subtitle, .case-text h2, .prose h2, .project-card h3 { text-wrap: balance; }

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-dark); }

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

/* ---------------- Header ---------------- */

.site-header {
  background: var(--ink);
  padding: 24px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  text-align: left;
}

.site-header .home-link {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--bg);
  letter-spacing: 0.01em;
  text-align: left;
  margin-right: auto;
}

.site-header .home-link:hover { color: var(--accent); }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.95rem;
  color: #c9c2b4;
}

.site-header nav a {
  color: var(--bg);
  text-decoration: none;
  border-bottom: 1px solid rgba(250,248,244,0.35);
}
.site-header nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.back-link:hover { color: var(--accent-dark); }

/* ---------------- Hero (home) ---------------- */

.hero {
  padding: 56px 0 28px;
}

.hero .eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 600;
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw + 0.5rem, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.hero .lede {
  font-size: clamp(1.05rem, 1.2vw + 0.7rem, 1.3rem);
  color: var(--ink-soft);
  max-width: none;
  margin: 0 0 8px;
}

/* The lede runs as wide as the first headline line (ending at "needs") and no wider */
.hero-copy { width: fit-content; max-width: 100%; }
.hero-copy .lede { width: 0; min-width: 100%; }

@media (max-width: 720px) {
  .wide-break { display: none; }
  .hero h1 { text-wrap: balance; }
}

/* ---------------- Project grid (home) ---------------- */

.work-section { padding: 8px 0 80px; }

.work-section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.work-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 36px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 36px 32px;
}

.project-card {
  text-decoration: none;
  color: var(--ink);
  display: block;
  group: card;
}

.project-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-alt);
  margin-bottom: 16px;
}

.project-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .thumb img { transform: scale(1.035); }
.project-card .thumb-chart { background: #ffffff; }
.project-card .thumb-chart img { object-fit: cover; }

.project-card .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 6px;
}

.project-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 6px;
  line-height: 1.25;
}

.project-card .desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0 0 10px;
  line-height: 1.5;
}

.project-card .meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* Featured (HTC) card spans wider */
.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
  background: var(--bg-alt);
  border-radius: 14px;
  padding: 20px;
}
.project-card.featured .thumb {
  aspect-ratio: 16 / 10;
  margin-bottom: 0;
}
.project-card.featured h3 { font-size: 1.7rem; }
.project-card.featured .desc { font-size: 1.05rem; }

@media (max-width: 720px) {
  .project-card.featured {
    grid-template-columns: 1fr;
  }
}

.appendix-link {
  margin: 44px 0 0;
  text-align: center;
}
.appendix-link a {
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.appendix-link a:hover { color: var(--accent-dark); border-color: var(--accent); }

/* ---------------- Case study page ---------------- */

.case-header { padding-top: 20px; }

.case-hero-copy { padding: 28px 0 36px; }

.case-header .eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 600;
  margin: 0 0 14px;
}

.case-header h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw + 0.5rem, 3.2rem);
  line-height: 1.08;
  margin: 0 0 10px;
}

.case-header .subtitle {
  font-size: clamp(1.05rem, 1vw + 0.8rem, 1.35rem);
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 40px;
  margin: 32px 0 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta-row .item .label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 4px;
}

.meta-row .item .value {
  font-size: 1.02rem;
  color: var(--ink);
  font-weight: 500;
}

.hero-image {
  margin: 40px 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-alt);
}
.hero-image img { width: 100%; }
.hero-image.full-bleed {
  border-radius: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

figure { margin: 0; }
figcaption {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 10px;
  text-align: center;
}

/* ---------------- Case study: text + media columns ---------------- */

.case-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px 56px;
  align-items: start;
  margin: 40px 0 0;
}

.case-text { min-width: 0; }
.case-text p {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 1.05rem;
}
.case-text h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin: 8px 0 16px;
}
.case-text .quote-tint { margin: 36px 0; }

.case-media {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.case-media figure img {
  width: 100%;
  border-radius: 10px;
  background: var(--bg-alt);
}

.case-media figcaption {
  text-align: left;
  margin-top: 8px;
}

.case-media .tag-list { margin-top: 10px; }

@media (max-width: 860px) {
  .case-layout { grid-template-columns: 1fr; }
  .case-media { flex-direction: column; }
  .case-media { order: 2; }
  .case-text { order: 1; }
}

/* About page: the text sets the row height and the image scales to match it */

.about-layout {
  grid-template-columns: minmax(0, 40rem) minmax(0, 1fr);
  align-items: stretch;
}
.about-text {
  max-width: 40rem;
  text-wrap: pretty;
}
.about-text p:last-child { margin-bottom: 0; }
.about-media figure {
  flex: 1;
  position: relative;
  margin: 0.45em 0;
}
.about-media figure img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  object-position: right top; /* keep the whole speech bubble in view */
}

@media (max-width: 1080px) {
  .about-layout { grid-template-columns: 1fr; }
  .about-media figure { flex: none; margin: 0; }
  .about-media figure img { position: static; height: auto; }
}

/* Design Challenge callout */

.challenge-box {
  background: var(--accent-tint);
  border-radius: 12px;
  padding: 16px 24px;
  margin: 0 -24px 28px;
}
.challenge-box p {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--ink);
}
.challenge-box p:last-child { margin-bottom: 0; }
.challenge-box strong { color: var(--accent-dark); }

/* Keep tinted callouts flush with the surrounding text column,
   letting the tint bleed slightly wider than the text itself. */
.case-text .quote-tint {
  margin-left: -24px;
  margin-right: -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.case-text ul { padding-left: 1.2em; margin: 0 0 22px; }
.case-text li { margin-bottom: 6px; color: var(--ink); }
.case-text figure { margin: 0 -24px 28px; }

.case-text .figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  margin: 0 -24px 28px;
}
.case-text .figure-pair figure { margin: 0; }

@media (max-width: 560px) {
  .case-text .figure-pair { grid-template-columns: 1fr; }
}
.case-text figure img { border-radius: 10px; width: 100%; display: block; }
.case-text figure figcaption {
  text-align: left;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}


/* Captions in the text column line up with the body text, not the wider image edge */
.case-text > figure figcaption { padding: 0 24px; }
.case-text .figure-pair figure:first-child figcaption { padding-left: 24px; }
.case-text figure figcaption ul { margin: 4px 0 0; padding-left: 1.2em; }
.case-text figure figcaption li { margin: 0 0 2px; color: inherit; }
.case-text figure figcaption strong { font-weight: 600; }

/* Lilly: three pens stacked to the height of the photo beside them.
   Each pen image is pre-sized so every pen renders at the same length
   and the three together match the photo's proportions (1942 x 2102). */
.case-text .pen-stack {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}
.case-text .pen-stack img {
  width: 100%;
  height: auto;
  background: var(--white);
  border-radius: 0;
}
.case-text .figure-pair figure:last-child figcaption { padding-right: 24px; }

/* Videos sit exactly within the text column (no bleed) */

/* Video in the text column */
.case-text figure video {
  width: 100%;
  display: block;
  border-radius: 10px;
  background: var(--ink);
  aspect-ratio: 16 / 9;
}

/* Small photo set beside a quote */

.quote-with-photo {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin: 40px 0;
}
.case-text .quote-with-photo figure { margin: 0; flex: 0 0 130px; width: 130px; }
.case-text .quote-with-photo figure img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  object-position: top center;
}
.case-text .quote-with-photo figcaption { padding: 0; }
.quote-with-photo .quote-tint { margin: 0; flex: 1; }

@media (max-width: 560px) {
  .quote-with-photo { flex-direction: column; }
  .case-text .quote-with-photo figure { flex: none; width: 110px; }
  .case-text .quote-with-photo figure img { width: 110px; height: 110px; }
}

/* ---------------- Prose / article body ---------------- */

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 8px 24px 12px;
}

.prose p { margin: 0 0 22px; color: var(--ink); }
.prose p.lead {
  font-size: 1.18rem;
  color: var(--ink-soft);
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  margin: 48px 0 18px;
}

.prose ul { padding-left: 1.2em; margin: 0 0 22px; }
.prose li { margin-bottom: 8px; }

.section-wide {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.section-wide h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  margin: 56px 0 22px;
  max-width: var(--measure);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Pull quote */

blockquote.pull {
  margin: 44px auto;
  max-width: 640px;
  padding: 0 0 0 28px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
}
blockquote.pull cite {
  display: block;
  margin-top: 14px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.quote-tint {
  background: var(--accent-tint);
  border-radius: 14px;
  padding: 22px 26px;
  margin: 32px 0;
}
.quote-tint blockquote.pull {
  margin: 0;
  border: none;
  padding: 0;
  color: var(--accent-dark);
}
.quote-tint blockquote.pull cite { color: var(--ink-soft); }

blockquote.pull .quote-context {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* Gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 40px 0;
}
.gallery img, .gallery .ph {
  border-radius: 10px;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery.thirds { grid-template-columns: repeat(3, 1fr); }
.gallery.one { grid-template-columns: 1fr; }

@media (max-width: 720px) {
  .gallery, .gallery.thirds { grid-template-columns: 1fr; }
}

.caption-note {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin-top: -10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 0;
}
.tag {
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 6px 14px;
}

/* ---------------- Case nav (prev/next) ---------------- */

.case-nav {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 40px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.case-nav a {
  text-decoration: none;
  max-width: 45%;
}

.case-nav .dir {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.case-nav .name {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
}
.case-nav a:hover .name { color: var(--accent-dark); }

.case-nav .next-link { text-align: right; margin-left: auto; }

@media (max-width: 560px) {
  .case-nav a { max-width: 100%; }
}

/* ---------------- Resume ---------------- */

.cv-lede { max-width: 46rem; }
.cv { padding-bottom: 40px; }

.cv-section {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px 56px;
  padding: 52px 0;
  border-top: 1px solid var(--line);
}
.cv-section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0;
  line-height: 1.25;
}
.cv-body { max-width: 46rem; }
.cv-body p { margin: 0; }
.cv-intro { color: var(--ink-soft); margin-bottom: 32px !important; }

/* Experience: company (bold), role and dates set tight; generous space between jobs */
.cv-job + .cv-job { margin-top: 44px; }
.cv-job-head { margin-bottom: 10px; line-height: 1.35; }
.cv-job h3 {
  font-family: var(--sans);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.3;
  margin: 0;
}
.cv-role { font-weight: 500; color: var(--ink); }
.cv-job > p { color: var(--ink); }

/* Education & Teaching: each entry single-spaced, more space between entries */
.cv-item { line-height: 1.35; }
.cv-item + .cv-item { margin-top: 26px; }
.cv-item h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.35;
  margin: 0;
}
.cv-item > p:not(.cv-org):not(.cv-dates) { color: var(--ink-soft); }
.cv-org { color: var(--accent-dark); font-weight: 500; }
.cv-dates {
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.cv-dev { list-style: none; padding: 0; margin: 0; }
.cv-dev li {
  display: flex;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.cv-dev li:last-child { border-bottom: none; }
.cv-dev .cv-dates { flex: 0 0 auto; min-width: 5.2em; }

/* Section divider inside a case study (e.g. between design challenges) */
.case-text .section-break {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 56px 0 44px;
}

@media (max-width: 760px) {
  .cv-section { grid-template-columns: 1fr; padding: 36px 0; }
}

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

.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 36px 0 40px;
  margin-top: 40px;
}

.site-footer h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.4vw + 0.5rem, 2.1rem);
  margin: 0 0 20px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .site-footer h2 { white-space: normal; text-wrap: balance; }
}

.site-footer .closing {
  color: #d8d2c6;
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0 0 32px;
  max-width: 46ch;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  align-items: baseline;
  margin-bottom: 40px;
}

.footer-contact a {
  color: var(--bg);
  font-size: 1.15rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(250,248,244,0.35);
}
.footer-contact a:hover { border-color: var(--bg); color: var(--bg); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  border-top: 1px solid rgba(250,248,244,0.15);
  font-size: 0.85rem;
  color: #a29c8f;
}
.footer-bottom a { color: #a29c8f; text-decoration: underline; }
.footer-bottom a:hover { color: var(--bg); }

/* ---------------- Utility ---------------- */

.mt-0 { margin-top: 0; }
.text-center { text-align: center; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding: 36px 0 44px; }
  .meta-row { gap: 20px 28px; }
  .quote-tint { padding: 28px 24px; }
}

/* Case study without a media column (Oracle) */
.case-layout.no-media { grid-template-columns: minmax(0, 760px); }

/* Small image credit line */
.photo-credit { margin: 32px 0 0; font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.02em; }
