/* ─────────────────────────────────────────────────────
   GRACE CHEE — Personal Website
   ───────────────────────────────────────────────────── */

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --bg:       #F3EFE7;
  --ink:      #1A1A1A;
  --muted:    #6B6B6B;
  --accent:   #E5380E;
  --line:     #D2D2D2;

  --font:     "Helvetica Neue", Helvetica, Arial, sans-serif;

  --edge:     clamp(1.25rem, 5vw, 4rem);
  --max:      1280px;

  /* grid columns: dot | client | title | type | role | year */
  --row-cols: 1.5rem 1.3fr 2.3fr 1.2fr 1.4fr 3.5rem;
  --row-gap:  1.5rem;
}

/* ── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video, gif { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }

/* ── BASE ───────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem var(--edge);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.site-name {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.site-name:hover { color: var(--muted); }

.site-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-link:hover,
.nav-link[aria-current="page"] { color: var(--ink); }

/* ─────────────────────────────────────────────────────
   INTRO
   ───────────────────────────────────────────────────── */
.intro {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--edge) clamp(2rem, 5vw, 4rem);
}

.intro-body {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.52;
  max-width: 62ch;
  margin-bottom: 0.875rem;
}
.intro-body strong { font-weight: 600; }

.intro-sub {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────────────────
   WORK INDEX
   ───────────────────────────────────────────────────── */
.work-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--edge) clamp(4rem, 10vw, 8rem);
}

/* column header row */
.index-header {
  display: grid;
  grid-template-columns: var(--row-cols);
  gap: var(--row-gap);
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.index-header span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.index-header .h-year { text-align: right; }

/* ─────────────────────────────────────────────────────
   PROJECT ROW
   ───────────────────────────────────────────────────── */
.project-row {
  border-bottom: 1px solid var(--line);
}

/* clickable trigger row */
.project-row__trigger {
  width: 100%;
  display: grid;
  grid-template-columns: var(--row-cols);
  gap: var(--row-gap);
  align-items: start;
  padding: 1rem 0;
  text-align: left;
  color: var(--ink);
  transition: color 0.15s;
}
.project-row__trigger:hover {
  color: var(--accent);
}

/* the mobile meta — invisible on desktop */
.col-mobile { display: none; }

/* ── dot ──────────────────────────────── */
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.25);
  background: transparent;
  flex-shrink: 0;
  justify-self: center;
  align-self: start;
  margin-top: 0.45rem;
  transition: background 0.15s, border-color 0.15s;
}
.dot.featured {
  background: var(--accent);
  border-color: var(--accent);
}
.project-row__trigger:hover .dot,
.project-row.is-open .project-row__trigger .dot {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── columns — inherit color from trigger, uniform weight ── */
.col-client,
.col-title,
.col-type,
.col-role {
  font-size: 1rem;
  font-weight: 600;
}

.col-year {
  font-size: 1rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────
   ACCORDION — CSS grid 0fr → 1fr trick
   ───────────────────────────────────────────────────── */
.project-row__content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.project-row.is-open > .project-row__content {
  grid-template-rows: 1fr;
}

.content-inner {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.24s ease 0.06s, transform 0.24s ease 0.06s;
}

.project-row.is-open > .project-row__content > .content-inner {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .project-row__content,
  .content-inner {
    transition: none;
  }
}

/* ─────────────────────────────────────────────────────
   EXPANDED CONTENT LAYOUT
   ───────────────────────────────────────────────────── */
.project-expanded {
  /* align with "client" column: dot-width + gap */
  padding: 2rem 0 3.5rem calc(1.5rem + var(--row-gap));
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: -1.25rem;
}
.status-badge::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── description ── */
.project-description {
  max-width: 58ch;
  font-size: 0.975rem;
  line-height: 1.65;
}
.project-description p { margin-bottom: 0.7rem; }
.project-description p:last-child { margin-bottom: 0; }
.project-description em { font-style: italic; }

/* ── meta table ── */
.project-meta {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  max-width: 500px;
  font-size: 0.85rem;
}

.meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.meta-value {
  padding: 0.45rem 0 0.45rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.4;
}
.meta-value.is-results { font-weight: 500; }
.meta-value.is-awards  { color: var(--muted); font-style: italic; }
.meta-value.is-note    { color: var(--muted); }

/* ─────────────────────────────────────────────────────
   GALLERY / CAROUSEL
   ───────────────────────────────────────────────────── */
.project-gallery {}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.gallery-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.carousel-item img {
  height: auto;
  width: auto;
  max-height: 400px;
  max-width: min(560px, 78vw);
  display: block;
  background: rgba(0,0,0,0.03);
}

.carousel-item img[src$=".gif"] {
  max-height: 400px;
  aspect-ratio: 4 / 3;
  width: auto;
  height: auto;
}

.carousel-item figcaption {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 0.5rem;
  text-align: center;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.carousel-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--ink);
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.carousel-btn:hover { border-color: var(--accent); color: var(--accent); }
.carousel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.carousel-count {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 2.75rem;
  text-align: center;
}

/* ─────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem var(--edge);
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.footer-name { font-weight: 500; }

.footer-email {
  color: var(--muted);
  transition: color 0.15s;
}
.footer-email:hover { color: var(--accent); }

.footer-copy {
  color: var(--muted);
  margin-left: auto;
}

/* ─────────────────────────────────────────────────────
   FOCUS RING
   ───────────────────────────────────────────────────── */
.project-row__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────
   INFO PAGE
   ───────────────────────────────────────────────────── */
.info-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--edge) clamp(4rem, 10vw, 8rem);
  display: grid;
  gap: 4rem;
}

.info-section h2 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}

/* statement */
.statement-body {
  font-size: 1rem;
  line-height: 1.72;
  max-width: 62ch;
}
.statement-body p { margin-bottom: 1.1rem; }
.statement-body p:last-child { margin-bottom: 0; }
.statement-body strong { font-weight: 600; }

/* experience */
.exp-list { display: grid; gap: 0; }

.exp-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}

.exp-left {}
.exp-role { font-weight: 500; display: block; }
.exp-context { color: var(--muted); font-size: 0.8rem; display: block; margin-top: 0.1rem; }
.exp-year { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }

/* clients */
.clients-text {
  font-size: 0.95rem;
  line-height: 1.9;
}

/* awards / grants / press list */
.awards-list {
  list-style: none;
  display: grid;
  gap: 0;
}
.awards-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.award-name { color: var(--ink); line-height: 1.4; }
.award-org  { color: var(--muted); font-size: 0.78rem; }
.award-project { color: var(--muted); font-size: 0.78rem; font-style: italic; }

/* education */
.edu-list { display: grid; gap: 1rem; }
.edu-item { font-size: 0.875rem; line-height: 1.5; }
.edu-degree { font-weight: 500; }
.edu-institution { color: var(--muted); }

/* contact */
.contact-body {
  font-size: 0.95rem;
  line-height: 1.9;
}
.contact-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.contact-body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.contact-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* portrait */
.portrait-img {
  width: 100%;
  display: block;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
  max-height: 55vh;
}

@media (min-width: 900px) {
  .portrait-img {
    max-height: none;
    aspect-ratio: auto;
    height: 100%;
    max-height: 600px;
  }
}

/* info wide layout */
@media (min-width: 900px) {
  .info-main {
    grid-template-columns: 1.4fr 1fr;
    grid-template-areas:
      "statement    portrait"
      "experience   education"
      "awards       grants"
      "clients      publications"
      "speaking     press"
      "contact      .";
    column-gap: clamp(3rem, 6vw, 6rem);
  }
  .info-statement    { grid-area: statement; }
  .info-portrait     { grid-area: portrait; }
  .info-experience   { grid-area: experience; }
  .info-education    { grid-area: education; }
  .info-awards       { grid-area: awards; }
  .info-grants       { grid-area: grants; }
  .info-clients      { grid-area: clients; }
  .info-publications { grid-area: publications; }
  .info-speaking     { grid-area: speaking; }
  .info-press        { grid-area: press; }
  .info-contact      { grid-area: contact; }
}

/* ── section divider ── */
.index-divider {
  padding: 1.5rem 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
}
.index-divider:first-child {
  border-top: none;
  padding-top: 0.75rem;
}
.index-divider span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.index-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ─────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────── */

/* tablet: hide type column */
@media (max-width: 1100px) and (min-width: 769px) {
  :root {
    --row-cols: 1.5rem 1.4fr 2.6fr 1.4fr 3.5rem;
  }
  .col-type,
  .h-type { display: none; }
}

/* mobile */
@media (max-width: 768px) {
  :root { --row-gap: 0.75rem; }

  .index-header { display: none; }

  .project-row__trigger {
    grid-template-columns: 1.5rem 1fr;
    grid-template-rows: auto auto;
    row-gap: 0.2rem;
    column-gap: 0.875rem;
    padding: 1rem 0;
  }

  /* hide desktop columns */
  .col-client,
  .col-type,
  .col-role,
  .col-year { display: none; }

  /* reposition remaining */
  .dot       { grid-row: 1 / 3; align-self: center; justify-self: center; }
  .col-title { grid-column: 2; grid-row: 1; font-size: 1rem; font-weight: 600; }

  /* show mobile meta */
  .col-mobile {
    display: block;
    grid-column: 2;
    grid-row: 2;
    font-size: 0.73rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-expanded {
    padding-left: 0;
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
    gap: 1.75rem;
  }

  .project-description { max-width: 100%; font-size: 0.9375rem; }

  .project-meta { max-width: 100%; }

  .carousel-item img { height: 260px; max-width: min(80vw, 400px); }

  .site-footer { gap: 1rem; }
  .footer-copy { margin-left: 0; width: 100%; }
}

/* ─────────────────────────────────────────────────────
   UTILITIES
   ───────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
