/* ==========================================================================
   Keane Tay — Portfolio
   ========================================================================== */

@font-face {
  font-family: "ABC Diatype";
  src: url("../fonts/abc-diatype-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABC Diatype";
  src: url("../fonts/abc-diatype-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABC Diatype";
  src: url("../fonts/abc-diatype-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABC Diatype";
  src: url("../fonts/abc-diatype-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #e4e4e4;
  --surface: #f6f6f6;
  --accent: #c8102e; /* used sparingly, echoes the Circadian red */
  --max: 1280px;
  --gutter: clamp(24px, 6vw, 96px);
  --font-head: "ABC Diatype", "Helvetica Neue", Arial, sans-serif;
  --font-body: "ABC Diatype", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* ---- Pills (frosted, minimal — PAF-inspired) ---- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(17,17,17,0.04);
  border: 1px solid rgba(17,17,17,0.08);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

a.pill:hover { background: rgba(17,17,17,0.08); border-color: rgba(17,17,17,0.14); }

.pill.icon-pill {
  padding: 9px;
  gap: 0;
  color: var(--muted);
}

.pill.icon-pill svg { display: block; flex: none; }

.li-badge {
  display: block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: -0.02em;
}

.pill-label {
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.35s ease, margin-left 0.35s ease, opacity 0.2s ease;
}

.expand-pill:hover .pill-label,
.expand-pill:focus-visible .pill-label {
  max-width: 220px;
  margin-left: 8px;
  opacity: 1;
}

.frosted {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
}

/* ---- Nav ---- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px var(--gutter) 0;
}

.site-nav .wrap { padding: 0; max-width: var(--max); margin: 0 auto; }

.nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 10px 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(17,17,17,0.08);
  box-shadow: 0 10px 30px rgba(17,17,17,0.06);
}

.nav-mark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.013em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.nav-links a {
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover { color: var(--fg); background: rgba(17,17,17,0.05); }

.nav-links a.current { color: var(--fg); background: rgba(17,17,17,0.06); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  margin-right: -6px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle.open span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ---- Hero ---- */

.hero {
  padding: clamp(64px, 14vh, 160px) 0 clamp(40px, 8vh, 96px);
}

.hero-title {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.039em;
  line-height: 0.95;
  font-size: clamp(21px, 3.97vw, 49px);
  margin: 0;
}

.hero-meta {
  margin-top: 40px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.hero-meta a:hover { color: var(--fg); }

/* ---- Section headings ---- */

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 14px;
}

.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.026em;
  font-size: clamp(22px, 3.2vw, 35px);
  margin: 0 0 8px;
}

section { padding: clamp(32px, 5.5vh, 72px) 0; }

.section-rule { border-top: 1px solid var(--line); }

#work { scroll-margin-top: 140px; }

/* ---- Intro statement (home) ---- */

.statement {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: clamp(12px, 1.3vw, 15px);
  line-height: 1.55;
  max-width: 640px;
  color: var(--fg);
}

.statement-lead { font-weight: 500; }

/* ---- Project index (home) ---- */

.work-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 36px;
}

.work-head .section-title { margin: 0; }

.work-head-sub { font-size: 12px; color: var(--muted); }

.project-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 42%);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.project-list-compact {
  display: flex;
  flex-direction: column;
}

.project-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 1px 0;
  width: fit-content;
  transform-origin: left center;
  transition: transform 0.2s ease;
}

.project-line:hover,
.project-line:focus-visible { transform: scale(1.045); }

.project-line-name {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.026em;
  font-size: clamp(18px, 2.2vw, 26px);
}

.project-line-cat {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.project-preview {
  position: sticky;
  top: 100px;
  min-height: 280px;
  max-height: 64vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-preview img {
  display: block;
  max-width: 100%;
  max-height: 64vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-preview img.is-landscape {
  max-width: 125%;
  max-height: 80vh;
}

.project-preview img.is-landscape.is-xl {
  max-width: 156.25%;
  max-height: 100vh;
}

.project-preview img.active { opacity: 1; }

@media (max-width: 860px) {
  .project-split { grid-template-columns: 1fr; }
  .project-preview { display: none; }
  .project-line:hover { transform: none; }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 8vh, 80px) 0;
  margin-top: clamp(40px, 8vh, 80px);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(12px, 2.2vw, 25px);
  letter-spacing: -0.026em;
}

.footer-links {
  display: flex;
  gap: 28px;
  font-size: 11px;
  color: var(--muted);
}

.footer-links a:hover { color: var(--fg); }

.footer-bottom {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Project / case-study page ---- */

.project-hero {
  padding: clamp(32px, 7vh, 80px) 0 clamp(20px, 4vh, 40px);
}

.project-hero .eyebrow { margin-bottom: 18px; }

.about-bio-col > .eyebrow {
  font-size: 11px;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.project-hero-title {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.039em;
  line-height: 0.98;
  font-size: clamp(32px, 6.0vw, 74px);
  margin: 0;
}

.project-hero-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(12px, 1.3vw, 14px);
  max-width: 720px;
}

/* case-grid: narrative overview (left) paired with a grouped facts
   sidebar (right) — labeled groups separated by rule, PAF/Abdus-inspired */
.case-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: clamp(32px, 6vw, 96px);
  padding-top: clamp(24px, 4vh, 40px);
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .case-grid { grid-template-columns: 1fr; }
}

.case-facts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fact-group { border-top: 1px solid var(--line); padding-top: 16px; }

.fact-group:first-child { border-top: none; padding-top: 0; }

.fact-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.0525em;
  color: var(--muted);
  margin: 0 0 8px;
}

.fact-value { margin: 0; font-size: 12px; }

.fact-value a { text-decoration: underline; text-underline-offset: 3px; }

.fact-value a:hover { color: var(--muted); }

.fact-group ul {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.6;
}

.fact-group li { margin-bottom: 6px; }

.fact-group li:last-child { margin-bottom: 0; }

/* wrapping multi-column variant of the facts list, used for dense
   reference material like a business model canvas */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(24px, 3vw, 36px) clamp(24px, 4vw, 48px);
}

.fact-grid .fact-group { border-top: 1px solid var(--line); padding-top: 16px; }

/* quote-style insight cards, e.g. research findings from a stakeholder interview */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.insight-card {
  background: var(--surface);
  border-radius: 4px;
  padding: clamp(20px, 3vw, 28px);
}

.insight-card p {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
}

/* persona card */
.persona-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(24px, 4vw, 40px);
}

.persona-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(19px, 2.4vw, 24px);
  letter-spacing: -0.013em;
  margin: 0 0 4px;
}

.persona-meta { color: var(--muted); font-size: 11px; margin: 0 0 28px; }

.persona-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}

@media (max-width: 760px) {
  .persona-grid { grid-template-columns: 1fr; }
}

.overview-text {
  max-width: 640px;
  font-size: clamp(13px, 1.3vw, 15px);
}

.overview-text p { margin: 0 0 1.2em; }

.overview-text p:last-child { margin-bottom: 0; }

/* media blocks */

.media { margin: 0; }

.media + .media { margin-top: 20px; }

.media img { width: 100%; border-radius: 2px; }

.media-cap {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}

.media-full { padding: 0; }

/* contained — for line diagrams / technical flats / CAD drawings that carry a lot
   of built-in white space, so they don't stretch into huge blank full-bleed voids */
.media-contained {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  padding: clamp(24px, 4vw, 48px);
  border-radius: 4px;
}

.media-contained img { border-radius: 0; }

/* medium — the default for supporting in-article images (not the page hero),
   so a single photo doesn't dominate the page at full content width */
.media-medium {
  max-width: 760px;
  margin: 0 auto;
}

.mini-heading {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.013em;
  margin: 0 0 12px;
}

.phase-block + .phase-block { margin-top: clamp(28px, 5vh, 48px); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px);
}

@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: clamp(24px, 5vw, 80px);
}

@media (max-width: 860px) {
  .content-grid { grid-template-columns: 1fr; }
}

.quote-block {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(16px, 2.1vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.013em;
  max-width: 880px;
}

.tag-pill {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  margin-right: 8px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--muted);
  background: rgba(17,17,17,0.04);
  border: 1px solid rgba(17,17,17,0.08);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 20px;
}

/* project nav (prev/next) */

.project-switch {
  border-top: 1px solid var(--line);
  padding: clamp(32px, 6vh, 64px) 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.switch-link { max-width: 48%; }

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

.switch-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.switch-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(18px, 2.7vw, 29px);
  letter-spacing: -0.026em;
}

.switch-link:hover .switch-name { text-decoration: underline; text-underline-offset: 6px; }

/* ---- About page ---- */

.about-top { padding-top: clamp(48px, 9vh, 100px); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) minmax(140px, 200px) minmax(260px, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.about-bio {
  max-width: 620px;
  font-size: clamp(13px, 1.3vw, 14px);
}

.about-bio p { margin: 0 0 1.3em; }

.about-bio p:last-child { margin-bottom: 0; }

.about-links {
  display: flex;
  flex-direction: column;
}

.about-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  font-size: 12.65px;
  border-bottom: 1px solid var(--line);
}

.about-links a:first-child { padding-top: 0; }

.about-links .arrow { color: var(--muted); transition: transform 0.2s ease; }

.about-links a:hover .arrow { transform: translateX(3px); }

.about-awards {
  display: flex;
  flex-direction: column;
}

.award-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.0525em;
  color: var(--muted);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.award-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: default;
}

.award-item:first-child { padding-top: 0; }

.award-item-title {
  font-size: 12.65px;
  font-weight: 500;
  color: var(--fg);
  margin: 0;
}

.award-item-org {
  font-size: 11px;
  color: var(--muted);
  margin: 3px 0 0;
}

.award-item-desc {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.35s ease;
}

.award-item-desc p {
  margin: 0;
  padding-top: 10px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--fg);
  max-width: 34ch;
}

.award-item:hover .award-item-desc,
.award-item:focus-visible .award-item-desc,
.award-item:focus-within .award-item-desc {
  max-height: 220px;
  margin-top: 2px;
  opacity: 1;
}

@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-links { flex-direction: row; flex-wrap: wrap; gap: 0 28px; }
  .about-links a { border-bottom: none; padding: 8px 0; }
}

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

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
}

@media (max-width: 760px) {
  .resume-grid { grid-template-columns: 1fr; }
}

.resume-block { margin-bottom: 40px; }

.resume-block h3 {
  font-family: var(--font-head);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  margin: 0 0 18px;
}

.resume-entry {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.resume-entry:last-child { border-bottom: none; }

.resume-year {
  width: 56px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
}

.resume-entry-title { font-weight: 500; }

.resume-entry-sub { color: var(--muted); font-size: 11px; }

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 11px;
}

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

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

@media (max-width: 640px) {
  .nav-mark { white-space: nowrap; }
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: #fff;
    border: 1px solid rgba(17,17,17,0.08);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(17,17,17,0.12);
  }

  .nav-links.open { display: flex; }

  .nav-links a { padding: 12px 16px; font-size: 12px; }
}

@media (max-width: 600px) {
  .project-thumb { display: none; }

  .project-row { flex-wrap: wrap; }
  .project-row-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1 1 auto;
  }
  .project-index { display: none; }
}
