/*
Theme Name: Calvin Portfolio
Theme URI: https://calvinchou.com/
Author: Calvin Chou
Description: A focused editorial portfolio for Calvin Chou's data and machine-learning work.
Version: 1.3.0
Text Domain: calvin-portfolio
*/

@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@300;400;600;700&display=swap');

:root {
  --paper: #f4f1ea;
  --paper-deep: #eae5da;
  --ink: #161713;
  --muted: #62645d;
  --line: rgba(22, 23, 19, 0.18);
  --white: #fffdf8;
  --oil: #dbe85d;
  --oil-deep: #25382d;
  --eia: #b9ddec;
  --eia-deep: #163f52;
  --content: 1240px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

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

.screen-reader-text,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
}

.site-shell {
  width: min(calc(100% - 48px), var(--content));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.69rem;
  letter-spacing: 0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  font-size: 0.78rem;
  font-weight: 680;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible { border-color: currentColor; }

.eyebrow {
  margin: 0 0 20px;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero {
  min-height: min(760px, calc(100vh - 84px));
  padding: clamp(72px, 10vw, 144px) 0 84px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.55fr);
  gap: clamp(52px, 9vw, 128px);
  align-items: end;
}

.hero h1 {
  max-width: 940px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 8.6vw, 7.8rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.hero h1 em {
  font-weight: 400;
  color: var(--muted);
}

.hero__intro {
  padding-bottom: 8px;
}

.hero__intro p {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.hero__education {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  font-size: 0.83rem;
  line-height: 1.45;
}

.hero__education span { color: var(--muted); }

.section {
  padding: clamp(88px, 11vw, 150px) 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: clamp(44px, 7vw, 82px);
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1.65fr);
  gap: 32px;
  align-items: start;
}

.section-heading h2 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.052em;
}

.project-list {
  display: grid;
  gap: 28px;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(420px, 1.16fr);
  min-height: 520px;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 60px rgba(22, 23, 19, 0.12);
}

.project-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.project-card--oil { background: var(--oil); }
.project-card--eia { background: var(--eia); }

.project-card__copy {
  padding: clamp(34px, 5vw, 66px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 44px;
}

.project-card__number {
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.15em;
}

.project-card h3 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 4vw, 4.6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.project-card p { margin: 0; max-width: 520px; }

.project-card__meta {
  margin-top: 28px;
  font-size: 0.7rem;
  font-weight: 740;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.project-card__link {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 740;
}

.project-card__link::after {
  content: "\2197";
  transition: transform 180ms ease;
}

.project-card:hover .project-card__link::after { transform: translate(3px, -3px); }

.project-card__visual {
  min-height: 420px;
  padding: clamp(30px, 5vw, 64px) 0 clamp(30px, 5vw, 64px) clamp(24px, 4vw, 54px);
  display: flex;
  align-items: center;
}

.dashboard-window {
  width: 100%;
  min-height: 390px;
  padding: 24px;
  border-radius: 18px 0 0 18px;
  background: #faf9f5;
  box-shadow: 0 25px 70px rgba(19, 28, 23, 0.2);
}

.dashboard-window__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 28px;
}

.dashboard-window__bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(22, 23, 19, 0.24);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-kpi,
.dashboard-panel {
  border: 1px solid rgba(22, 23, 19, 0.11);
  background: #fff;
}

.dashboard-kpi { min-height: 66px; padding: 12px; }
.dashboard-kpi strong { display: block; font-size: 1rem; }
.dashboard-kpi span { font-size: 0.57rem; color: var(--muted); }
.dashboard-panel { padding: 16px; }
.dashboard-panel svg { width: 100%; height: auto; }

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.atlas-grid .dashboard-panel { min-height: 118px; }

.about-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.55fr);
  gap: clamp(48px, 9vw, 120px);
  align-items: start;
}

.about-strip__statement {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.about-strip__aside p { margin-top: 0; }

.text-link {
  display: inline-block;
  padding-bottom: 2px;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  font-size: 0.82rem;
  font-weight: 730;
}

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer a { text-decoration: none; }

/* Project case studies */
.case-hero {
  padding: clamp(72px, 10vw, 132px) 0 clamp(64px, 8vw, 110px);
}

.case-hero h1 {
  max-width: 940px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 8vw, 7.5rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.064em;
}

.case-hero__dek {
  max-width: 760px;
  margin: 44px 0 0 auto;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.55;
}

.case-dashboard-link {
  display: inline-block;
  margin-top: 36px;
}

.case-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  margin-top: 36px;
}

.case-action-links .case-dashboard-link { margin: 0; }

.case-action-links .text-link {
  padding-bottom: 0;
  border-bottom: 0;
}

.case-action-links a { text-decoration: none; }

.case-banner {
  padding: clamp(40px, 6vw, 80px);
  min-height: 480px;
  display: grid;
  place-items: center;
}

.case-banner--oil { background: var(--oil-deep); }
.case-banner--eia { background: var(--eia-deep); }
.case-banner .dashboard-window { max-width: 960px; border-radius: 18px; }

.case-live-dashboard {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 0 24px;
}

.case-live-dashboard iframe {
  display: block;
  width: 100%;
  height: min(88vh, 980px);
  min-height: 680px;
  border: 1px solid var(--line);
  background: #fff;
}

.case-live-dashboard__fallback {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.case-content {
  max-width: 980px;
  padding-top: clamp(80px, 10vw, 140px);
  padding-bottom: clamp(90px, 12vw, 160px);
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 64px;
  margin-bottom: 72px;
  border-bottom: 1px solid var(--line);
}

.case-fact span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 740;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.case-content h2 {
  margin: 72px 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.case-content p,
.case-content ul { max-width: 760px; }
.case-content li + li { margin-top: 12px; }
.case-back { margin-bottom: 42px; }

.default-page { padding: 90px 0 130px; max-width: 820px; }
.default-page h1 { font-family: Georgia, serif; font-size: clamp(3rem, 7vw, 6rem); line-height: 1; }

@media (max-width: 900px) {
  .hero,
  .about-strip { grid-template-columns: 1fr; }

  .hero { min-height: auto; }

  .hero__intro { max-width: 660px; }

  .section-heading { grid-template-columns: 1fr; gap: 12px; }

  .project-card { grid-template-columns: 1fr; }
  .project-card__visual { padding-left: 32px; }
  .project-card__copy { min-height: 420px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-shell { width: min(calc(100% - 32px), var(--content)); }
  .site-header__inner { min-height: 72px; }
  .brand__name { display: none; }
  .site-nav { gap: 18px; font-size: 0.66rem; }
  .hero { padding-top: 70px; }
  .hero h1 { font-size: clamp(3.2rem, 18vw, 5.4rem); }
  .project-card__copy { min-height: 390px; padding: 30px; }
  .project-card__visual { min-height: 330px; padding: 24px 0 24px 20px; }
  .dashboard-window { min-height: 300px; padding: 16px; }
  .dashboard-kpis { grid-template-columns: 1fr 1fr; }
  .dashboard-kpi:last-child { display: none; }
  .case-facts { grid-template-columns: 1fr; }
  .case-banner { min-height: 360px; padding: 24px 0 24px 20px; }
  .case-banner .dashboard-window { border-radius: 18px 0 0 18px; }
  .case-live-dashboard { padding: 0; }
  .case-live-dashboard iframe { min-height: 620px; border-width: 1px 0; }
  .site-footer__inner { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* Minimal full-screen landing page, modeled on the supplied portfolio reference. */
body.landing-page {
  min-height: 100%;
  background: #000;
  color: #fff;
  font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body.landing-page.admin-bar .landing { min-height: calc(100svh - 32px); }

.landing {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.landing-nav {
  position: absolute;
  z-index: 10;
  top: clamp(32px, 5vw, 68px);
  right: clamp(28px, 6vw, 92px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(24px, 3.25vw, 54px);
}

.landing-nav a {
  position: relative;
  color: #fff;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.landing-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.landing-nav a:hover::after,
.landing-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.landing-nav a:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 9px;
}

.landing-main {
  width: min(calc(100% - 56px), 1180px);
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(128px, 16vh, 190px) 0 clamp(64px, 10vh, 110px);
  display: flex;
  align-items: center;
}

.landing-copy {
  width: min(100%, 890px);
  margin-inline: auto;
}

.landing-copy h1 {
  max-width: 850px;
  margin: 0;
  color: #fff;
  font-size: clamp(1.32rem, 2.05vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.52;
}

.landing-experience-space {
  height: clamp(44px, 8vh, 92px);
}

.landing-education {
  margin-top: clamp(44px, 8vh, 92px);
}

.landing-education h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.landing-education ul {
  margin: 0;
  padding-left: 1.25em;
}

.landing-education li {
  padding-left: 0.24em;
  color: #fff;
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.65;
}

.landing-education li + li { margin-top: 5px; }

.landing-skip-link:focus {
  background: #fff;
  color: #000;
}

@media (max-width: 782px) {
  body.landing-page.admin-bar .landing { min-height: calc(100svh - 46px); }

  .landing-nav {
    top: 30px;
    right: 24px;
    gap: 23px;
  }

  .landing-nav a {
    font-size: 0.67rem;
    letter-spacing: 0.045em;
  }

  .landing-main {
    width: calc(100% - 48px);
    padding-top: 116px;
    align-items: center;
  }

  .landing-copy h1 {
    font-size: clamp(1.18rem, 5.2vw, 1.55rem);
    line-height: 1.48;
  }

  .landing-experience-space { height: clamp(38px, 7vh, 66px); }

  .landing-education { margin-top: clamp(38px, 7vh, 66px); }
}

@media (max-width: 420px) {
  .landing-nav {
    right: 18px;
    left: 18px;
    justify-content: space-between;
    gap: 14px;
  }

  .landing-main { width: calc(100% - 40px); }

  .landing-education li {
    font-size: 0.82rem;
    line-height: 1.55;
  }
}

/* Portfolio index */
body.portfolio-index-page {
  min-height: 100%;
  margin: 0;
  background: #000;
  color: #fff;
  font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.portfolio-index {
  position: relative;
  min-height: 100svh;
  background: #000;
  color: #fff;
}

.portfolio-home-link {
  position: absolute;
  z-index: 10;
  top: clamp(32px, 5vw, 68px);
  left: clamp(28px, 6vw, 92px);
  color: #fff;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.portfolio-home-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.portfolio-home-link:hover,
.portfolio-home-link:focus-visible {
  outline: none;
}

.portfolio-home-link:hover::after,
.portfolio-home-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.portfolio-main {
  width: min(calc(100% - 56px), 1080px);
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(150px, 22vh, 230px) 0 90px;
}

.portfolio-heading {
  margin: 0 0 clamp(44px, 8vh, 82px);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.portfolio-projects {
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.portfolio-projects p { margin: 0; }

.portfolio-projects a {
  display: block;
  padding: clamp(27px, 4.5vw, 52px) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: clamp(1.75rem, 4.6vw, 4.4rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.08;
  text-decoration: none;
  transition: opacity 160ms ease, padding-left 160ms ease;
}

.portfolio-projects a:hover,
.portfolio-projects a:focus-visible {
  padding-left: 12px;
  opacity: 0.58;
}

.portfolio-projects a:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 8px;
}

/* On-site notebook project pages */
body.project-detail-page,
body.oil-market-project-page {
  min-height: 100%;
  margin: 0;
  background: #000;
  color: #fff;
  font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.project-detail__top {
  width: min(calc(100% - 56px), 1320px);
  min-height: 88px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.project-detail__top a,
.project-detail__notebook-head a {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
}

.project-detail__notebook-head p { margin: 0; }

.project-detail__top a:hover,
.project-detail__top a:focus-visible,
.project-detail__notebook-head a:hover,
.project-detail__notebook-head a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.project-detail__main {
  width: min(calc(100% - 56px), 1320px);
  margin-inline: auto;
  padding: clamp(64px, 9vw, 126px) 0 100px;
}

.project-detail__label {
  margin: 0 0 18px;
  color: #aaa;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-detail__main h1 {
  max-width: 1000px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 6vw, 6rem);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 1;
}

.project-detail__notebook {
  margin-top: clamp(70px, 10vw, 140px);
}

.project-detail__notebook-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.project-detail__notebook-head h2 {
  margin: 0;
  color: #fff;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-detail__frame {
  width: 100%;
  height: max(760px, 82vh);
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: #fff;
}

body.oil-market-project-page .case-live-dashboard__fallback {
  color: #aaa;
}

body.oil-market-project-page .case-live-dashboard {
  padding-bottom: 64px;
}

@media (max-width: 782px) {
  .portfolio-home-link {
    top: 30px;
    left: 24px;
    font-size: 0.67rem;
    letter-spacing: 0.045em;
  }

  .portfolio-main {
    width: calc(100% - 44px);
    padding-top: 136px;
  }

  .project-detail__top,
  .project-detail__main {
    width: calc(100% - 40px);
  }

  .project-detail__top { min-height: 74px; }

  .project-detail__notebook-head {
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .project-detail__frame {
    width: calc(100% + 40px);
    height: 78vh;
    margin-left: -20px;
    border-right: 0;
    border-left: 0;
  }
}

@media (max-width: 420px) {
  body.portfolio-index-page .landing-nav { left: auto; }

  .portfolio-home-link { left: 18px; }
}

body.portfolio-index-page .portfolio-navigation {
  left: clamp(28px, 6vw, 92px);
}

.portfolio-navigation-home { margin-right: auto; }

@media (max-width: 782px) {
  body.portfolio-index-page .portfolio-navigation { left: 24px; }
}

@media (max-width: 420px) {
  body.portfolio-index-page .portfolio-navigation { left: 18px; }
}
