/* Portfolio styles. Lexend is loaded via <link> in index.html. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-y: scroll; }

:root {
  --bg: #FCFCFC;
  --text: #1C1C1C;
  --text-mid: #5C5C5A;
  --text-light: #6E6E6B;
  --rule: #E8E8E6;
  --card-light: #F2F2F0;
  --card-mid: #DDDDDA;
  --card-dark: #4A4A47;
  --card-dark-text: #F8F8F6;
  --lock: #767673;
  --nav-h: 79px;
}

body { font-family: 'Lexend', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }

.page { display: none; }
.page.active { display: flex; flex-direction: column; min-height: 100vh; }
.page-inner { max-width: 1280px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; flex: 1; }

/* NAV */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}
.site-name { font-size: 14px; font-weight: 400; letter-spacing: 0.01em; color: var(--text); cursor: pointer; text-decoration: none; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { font-size: 13px; font-weight: 400; color: var(--text-light); text-decoration: none; transition: color 0.15s; cursor: pointer; }
.nav-links a:hover, .nav-links a.on { color: var(--text); }

/* Accessibility utilities */
main { display: contents; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
a:focus, button:focus, [tabindex]:focus, input:focus {
  outline: none;
}
body.user-is-tabbing a:focus,
body.user-is-tabbing button:focus,
body.user-is-tabbing [tabindex]:not([tabindex="-1"]):focus,
body.user-is-tabbing input:focus {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== HOME ===== */
.hero { display: grid; grid-template-columns: 1fr 1fr; flex: 1; }

.hero-left { padding: 56px 52px; display: flex; flex-direction: column; }
.hero-statement { font-size: 28px; font-weight: 400; line-height: 1.38; max-width: 400px; color: var(--text); }
.hero-statement strong { font-weight: 600; }
.hero-secondary { font-size: 14px; font-weight: 300; color: var(--text-mid); line-height: 1.78; max-width: 400px; margin-top: 20px; }
.hero-secondary a { color: var(--text-mid); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); transition: text-decoration-color 0.15s; }
.hero-secondary a:hover { text-decoration-color: var(--text-mid); }

.hero-cycle { color: var(--text); text-decoration: none; }
.hero-caret { display: inline-block; width: 2px; height: 0.95em; margin-left: 3px; border-radius: 1px; background: var(--text); vertical-align: text-bottom; transform: translateY(-0.05em); }
.hero-caret.is-blinking { animation: heroCaretBlink 1.05s steps(1) infinite; }
@keyframes heroCaretBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-caret { display: none; }
}

.hero-tag { margin-top: 20px; color: var(--text-light); font-size: 12px; font-weight: 300; }

.hero-right { padding: 56px 52px; }

/* Case study list cards */
.cs-list-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  padding: 18px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0 -14px 2px;
  text-decoration: none;
  color: inherit;
}
.cs-list-item:hover { background: var(--card-light); box-shadow: inset 0 0 0 1.5px var(--card-mid); }

.cs-list-num { font-size: 12px; font-weight: 300; color: var(--text-light); padding-top: 3px; letter-spacing: 0.03em; }
.cs-list-content { display: flex; flex-direction: column; gap: 6px; }
.cs-list-title { font-size: 16px; font-weight: 500; color: var(--text); line-height: 1.3; }
.cs-list-desc { font-size: 13px; font-weight: 300; color: var(--text-mid); line-height: 1.65; }
.cs-list-foot { display: flex; align-items: center; gap: 16px; margin-top: 2px; }
.cs-list-company { font-size: 12px; color: var(--text-light); font-weight: 300; line-height: 1; }
.cs-lock { font-size: 12px; color: var(--text-light); display: inline-flex; align-items: center; gap: 4px; font-weight: 300; white-space: nowrap; line-height: 1; }
.cs-lock svg { width: 10px; height: 10px; flex-shrink: 0; }

/* ===== CASE STUDY ===== */
.cs-layout { display: grid; grid-template-columns: 256px 1fr; flex: 1; }

.cs-sidebar {
  padding: 44px 24px 44px 52px;
  position: sticky;
  top: var(--nav-h);
  align-self: start;
  display: flex;
  flex-direction: column;
}
.btn-tertiary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  text-decoration: none;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-tertiary:hover { background: var(--card-light); color: var(--text-mid); box-shadow: 0 0 0 1.5px var(--text-light); }
.cs-btn-wrap { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 32px 0; }
.cs-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: var(--text-mid); text-decoration: none; font-family: inherit; padding: 10px 20px; border-radius: 6px; border: 1.5px solid var(--rule); background: transparent; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.cs-btn:hover { background: var(--card-light); color: var(--text); border-color: var(--text-light); text-decoration: none; }
.back-btn { margin-bottom: 36px; align-self: flex-start; margin-left: -12px; }
.sb-title { font-size: 15px; font-weight: 500; line-height: 1.38; margin-bottom: 4px; color: var(--text); }
.sb-sub { font-size: 12px; font-weight: 300; color: var(--text-mid); margin-bottom: 2px; }
.sb-year { font-size: 12px; font-weight: 300; color: var(--text-light); margin-bottom: 40px; }

.toc-heading { font-size: 11px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-light); margin-bottom: 12px; }
.toc { list-style: none; display: flex; flex-direction: column; }
.toc li { padding: 0; }
.toc a { display: block; padding: 6px 0; font-size: 13px; font-weight: 500; color: var(--text-light); text-decoration: none; transition: color 0.15s; line-height: 1.45; }
.toc li.on a { color: var(--text); }
.toc a:hover { color: var(--text); }

.cs-body { padding: 44px 64px 80px 56px; }

.cs-h1 { font-size: 28px; font-weight: 600; line-height: 1.25; margin-bottom: 24px; color: var(--text); scroll-margin-top: calc(var(--nav-h) + 20px); }
.cs-mobile-meta { display: none; }
.cs-overview-p { font-size: 15px; font-weight: 300; line-height: 1.8; color: var(--text); margin-bottom: 36px; }

.pso-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; border-radius: 6px; overflow: hidden; margin-bottom: 56px; }
.pso-col { padding: 22px 20px; }
.pso-col.p-col { background: var(--card-light); }
.pso-col.s-col { background: var(--card-mid); }
.pso-col.o-col { background: var(--card-dark); color: var(--card-dark-text); }
.pso-lbl { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.p-col .pso-lbl { color: var(--text-light); }
.s-col .pso-lbl { color: var(--text-mid); }
.o-col .pso-lbl { color: rgba(248,248,246,0.7); }
.pso-col p { font-size: 13px; font-weight: 300; line-height: 1.65; }
.o-col p { color: var(--card-dark-text); }
.pso-col strong { font-weight: 500; }
.o-col strong { font-weight: 600; }

.cs-h2 { font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 16px; margin-top: 44px; color: var(--text); scroll-margin-top: calc(var(--nav-h) + 20px); }
.cs-h3 { font-size: 14px; font-weight: 500; line-height: 1.4; margin-bottom: 8px; margin-top: 28px; color: var(--text); }
.cs-p { font-size: 15px; font-weight: 300; line-height: 1.82; color: var(--text); margin-bottom: 18px; }
.cs-p strong { font-weight: 500; }

.pullquote { background: var(--card-light); border-radius: 6px; padding: 20px 24px; margin: 32px 0; }
.pullquote p { font-size: 16px; font-weight: 300; font-style: italic; color: var(--text-mid); line-height: 1.65; margin-bottom: 10px; }
.pullquote cite { font-size: 12px; color: var(--text-light); font-weight: 400; }

.callout-card { border: 1.5px solid var(--rule); border-left: 3px solid var(--card-dark); border-radius: 6px; padding: 20px 24px; margin: 32px 0; background: var(--card-light); }
.callout-title { font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-light); margin-bottom: 10px; }
.callout-card p { font-size: 14px; font-weight: 300; line-height: 1.75; color: var(--text-mid); margin: 0; }
.callout-card p strong { font-weight: 500; color: var(--text); }
.cs-body a:not(.cs-btn) { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); transition: text-decoration-color 0.15s, color 0.15s; }
.cs-body a:not(.cs-btn):hover { text-decoration-color: var(--text-mid); color: var(--text); }

.img-ph { background: var(--card-light); border-radius: 6px; height: 200px; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin: 28px 0; font-weight: 400; }

/* ===== ABOUT ===== */
.about-layout { display: grid; grid-template-columns: 288px 1fr; flex: 1; }

.about-left {
  padding: 44px 24px 44px 52px;
  position: sticky;
  top: var(--nav-h);
  align-self: start;
}
.photo-box { width: calc(100% + 24px); margin-right: -24px; aspect-ratio: 4/5; background: var(--card-light); border-radius: 6px; margin-bottom: 24px; overflow: hidden; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

.qlinks { list-style: none; display: flex; flex-direction: column; }
.qlinks li { display: flex; gap: 12px; font-size: 13px; padding: 8px 0; align-items: center; }
.ql-lbl { color: var(--text-light); font-size: 12px; font-weight: 300; min-width: 60px; flex-shrink: 0; }
.qlinks a:not(.btn-tertiary) { color: var(--text-mid); font-weight: 300; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); transition: text-decoration-color 0.15s; }
.qlinks a:not(.btn-tertiary):hover { text-decoration-color: var(--text-mid); color: var(--text-mid); }


/* Email copy button */
.email-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mid);
  font-family: inherit;
  font-size: 13px;
  font-weight: 300;
  padding: 0;
  transition: color 0.15s;
}
.email-copy-btn:hover { color: var(--text); }
.copy-icon-copy { display: inline-flex; align-items: center; }
.copy-icon-check { display: none; align-items: center; }
.copy-icon-copy svg, .copy-icon-check svg { width: 12px; height: 12px; }
.email-copy-btn:hover .email-text { font-style: italic; }
.email-copy-btn.copied .copy-icon-copy { display: none; }
.email-copy-btn.copied .copy-icon-check { display: inline-flex; }

.about-right { padding: 44px 64px 80px 56px; }
.about-name { font-size: 34px; font-weight: 600; line-height: 1.15; margin-bottom: 20px; color: var(--text); }
.about-subtitle { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 20px; }
.about-emoji { width: 28px; height: 28px; flex-shrink: 0; }

.about-bio p { font-size: 15px; font-weight: 300; line-height: 1.82; color: var(--text); margin-bottom: 16px; }
.about-bio strong { font-weight: 500; }
.about-bio a { color: var(--text-mid); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); transition: text-decoration-color 0.15s; }
.about-bio a:hover { text-decoration-color: var(--text-mid); }

.sec-head { font-size: 12px; font-weight: 500; color: var(--text-mid); letter-spacing: 0.06em; text-transform: uppercase; margin: 44px 0 8px; }

/* val-list: first item flush with sec-head, last item no divider */
.val-list .val-item:first-child { padding-top: 0; }
.val-list .val-item:last-child { border-bottom: none; }

.val-item { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.val-title { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.val-desc { font-size: 14px; font-weight: 300; color: var(--text-mid); line-height: 1.68; }

.exp-table { width: 100%; border-collapse: collapse; }
.exp-table tr + tr td { padding-top: 10px; }
.exp-table td { padding-bottom: 10px; font-size: 13px; font-weight: 300; vertical-align: top; }
.exp-table td:first-child { color: var(--text-light); width: 110px; padding-right: 20px; }
.exp-table td:nth-child(2) { color: var(--text-mid); width: 180px; }
.exp-table td:last-child { color: var(--text); }

/* FOOTER */
.site-footer {
  padding: 24px 52px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-light);
  margin-top: auto;
}
.footer-credits { display: flex; align-items: center; gap: 6px; }
.footer-credit { display: inline-flex; align-items: center; gap: 5px; }
.footer-credit .emoji { font-size: 15px; }
.footer-sep { color: var(--rule); user-select: none; }

/* ===== PASSWORD GATE ===== */
.pw-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px 80px; }
.pw-card { max-width: 360px; width: 100%; }
.pw-title { font-size: 36px; font-weight: 600; line-height: 1.2; color: var(--text); margin-bottom: 14px; }
.pw-subtitle { font-size: 15px; font-weight: 300; color: var(--text-mid); margin-bottom: 32px; line-height: 1.6; }
.pw-field-wrap { position: relative; margin-bottom: 6px; }
.pw-field { width: 100%; padding: 11px 42px 11px 15px; font-size: 14px; font-family: inherit; font-weight: 300; background: var(--card-light); border: 1.5px solid transparent; border-radius: 8px; color: var(--text); transition: border-color 0.15s; }
.pw-masked { -webkit-text-security: disc; text-security: disc; }
body.user-is-tabbing .pw-field:focus { border-color: var(--text); }
.pw-field::placeholder { color: var(--text-light); }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-light); padding: 4px; display: flex; align-items: center; transition: color 0.15s; }
.pw-toggle:hover { color: var(--text-mid); }
.pw-toggle svg { width: 15px; height: 15px; }
.pw-error { font-size: 13px; color: #C0392B; margin-bottom: 16px; min-height: 18px; opacity: 0; transition: opacity 0.15s; }
.pw-error.show { opacity: 1; }
.pw-unlock { width: 100%; padding: 11px; background: var(--text); color: var(--bg); font-family: inherit; font-size: 14px; font-weight: 500; border: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; transition: opacity 0.15s; }
.pw-unlock:hover { opacity: 0.82; }
.pw-lock-icon { position: relative; display: inline-flex; width: 14px; height: 14px; flex-shrink: 0; }
.pw-lock-icon svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.2s ease; }
.pw-lock-locked { opacity: 1; }
.pw-lock-open { opacity: 0; }
.pw-unlock:hover .pw-lock-locked { opacity: 0; }
.pw-unlock:hover .pw-lock-open { opacity: 1; }

/* ===== PLAY ===== */
.play-list-item {
  display: block;
  padding: 18px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0 -14px 2px;
  text-decoration: none;
  color: inherit;
}
.play-list-item:hover { background: var(--card-light); box-shadow: inset 0 0 0 1.5px var(--card-mid); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-nav { padding: 20px 24px; }

  /* Home + Play */
  .hero { grid-template-columns: 1fr; flex: none; align-items: start; }
  .hero-left { padding: 40px 24px 20px; max-width: none; }
  .hero-right { padding: 4px 24px 48px; }
  .hero-statement { font-size: 22px; max-width: none; }
  .hero-secondary { max-width: none; }
  .cs-list-item { margin: 0 0 2px; padding: 16px 8px; }

  /* Case study: stack, hide TOC */
  .cs-layout { grid-template-columns: 1fr; }
  .cs-sidebar {
    position: relative;
    top: auto;
    max-height: none;
    overflow-y: visible;
    padding: 32px 24px 0;
  }
  .toc-heading, .toc, .sb-title { display: none; }
  .cs-sidebar .sb-sub, .cs-sidebar .sb-year { display: none; }
  .cs-body { padding: 16px 24px 64px; }
  .cs-h1 { font-size: 22px; margin-bottom: 8px; }
  .cs-mobile-meta { display: block; margin-bottom: 28px; }
  .cs-mobile-meta .sb-sub { display: block; font-size: 12px; font-weight: 300; color: var(--text-mid); }

  /* About: stack layout, but photo + links side-by-side */
  .about-layout { grid-template-columns: 1fr; }
  .about-left {
    position: relative;
    top: auto;
    max-height: none;
    overflow-y: visible;
    padding: 32px 24px 20px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
  }
  .photo-box {
    width: 120px;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    margin: 0;
    border-radius: 6px;
  }
  .qlinks { flex: 1; }
  .qlinks li { padding: 6px 0; }
  .about-right { padding: 4px 24px 64px; }
  .about-name { font-size: 26px; }

  .site-footer { padding: 20px 24px 28px; flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Play */
  .play-list-item { margin: 0 0 2px; padding: 16px 8px; }
}

@media (max-width: 600px) {
  .pso-cards { grid-template-columns: 1fr; }
  .pso-col.p-col { border-radius: 6px 6px 0 0; }
  .pso-col.o-col { border-radius: 0 0 6px 6px; }
}
