/* ==========================================================================
   Portfolio + HTS Case Study — single shared stylesheet
   Zero JavaScript. System fonts only. No external assets, no web fonts.
   One cached request for the whole site (preloaded in <head>).
   ========================================================================== */

:root {
  --color-primary: #1a365d;   /* HTS navy   */
  --color-secondary: #2b6cb0; /* link blue  */
  --color-dark: #2d3748;      /* body text  */
  --color-light: #f7fafc;     /* panel bg   */
  --color-accent: #dd6b20;    /* HTS orange */
  --color-border: #e2e8f0;
  --color-muted: #718096;
  --color-live: #c53030;      /* "before" / thin-content red */
  --color-proto: #2f855a;     /* "after" / prototype green   */
  --maxw: 1080px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(26, 54, 93, .08), 0 8px 24px rgba(26, 54, 93, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: var(--color-dark);
  background: #fff;
  margin: 0;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; color: var(--color-primary); margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); margin-top: 2.2rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1.1rem; }
a { color: var(--color-secondary); text-underline-offset: 2px; }
a:hover { color: var(--color-primary); }
strong { color: var(--color-primary); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-primary); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* ---------- Header / case-study step nav (CSS-only mobile toggle) -------- */
.cs-header { background: var(--color-primary); color: #fff; position: sticky; top: 0; z-index: 50; }
.cs-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.25rem; flex-wrap: wrap; }
.cs-brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap; }
.cs-brand span { color: #cbd5e0; font-weight: 500; }

.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

.cs-nav { display: flex; gap: .25rem 1rem; flex-wrap: wrap; align-items: center; }
.cs-nav a {
  color: #cbd5e0; text-decoration: none; font-size: .82rem; font-weight: 600;
  padding: .25rem 0; white-space: nowrap; border-bottom: 2px solid transparent;
}
.cs-nav a:hover { color: #fff; }
.cs-nav a.active { color: #fff; border-bottom-color: var(--color-accent); }

/* CSS-only dropdown (mirrors the prototype's own nav pattern) */
.has-drop { position: relative; display: inline-flex; }
.drop {
  display: none; position: absolute; top: 100%; left: -.7rem;
  background: var(--color-primary); border-radius: 0 0 8px 8px;
  padding: .55rem 1rem .75rem; min-width: 215px;
  flex-direction: column; gap: .1rem; box-shadow: var(--shadow); z-index: 70;
}
.has-drop:hover .drop, .has-drop:focus-within .drop { display: flex; }
.drop a { font-size: .8rem; padding: .28rem 0; border-bottom: none !important; }
.drop a.active { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .has-drop { flex-direction: column; }
  .drop { position: static; display: flex; background: transparent; padding: .1rem 0 .25rem 1.1rem; min-width: 0; box-shadow: none; }
}

@media (max-width: 860px) {
  .nav-toggle-label {
    display: inline-flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px;
  }
  .nav-toggle-label span { width: 26px; height: 3px; background: #fff; border-radius: 2px; }
  .cs-nav {
    flex-basis: 100%; flex-direction: column; align-items: flex-start; gap: .15rem;
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-toggle:checked ~ .cs-nav { max-height: 32rem; padding-top: .6rem; }
  .cs-nav a { font-size: .95rem; padding: .4rem 0; }
}

/* ---------- Generic section / hero ------------------------------------- */
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700;
  color: var(--color-accent); margin: 0 0 .6rem;
}
.page-hero { padding: 2.6rem 0 1.4rem; border-bottom: 1px solid var(--color-border); }
.lead { font-size: 1.18rem; color: #3a4a61; max-width: 64ch; }
main { padding-bottom: 3rem; }
article > section { margin-top: 1.4rem; }

.btn {
  display: inline-block; background: var(--color-accent); color: #fff; text-decoration: none;
  font-weight: 700; padding: .7rem 1.25rem; border-radius: var(--radius); border: 2px solid var(--color-accent);
}
.btn:hover { background: #c45e16; border-color: #c45e16; color: #fff; }
.btn-ghost { background: transparent; color: var(--color-primary); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-light); color: var(--color-primary); border-color: var(--color-primary); }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.4rem 0; }

/* ---------- Four-pillar grid ------------------------------------------- */
.pillars { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.4rem 0; }
@media (min-width: 680px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
.pillar {
  border: 1px solid var(--color-border); border-top: 4px solid var(--color-accent);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; background: #fff; box-shadow: var(--shadow);
}
.pillar h3 { margin-bottom: .3rem; }
.pillar p { margin: 0; font-size: .95rem; color: #46546a; }

/* ---------- Disparity: live (thin) vs prototype (rich) ----------------- */
.disparity { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.4rem 0; }
@media (min-width: 760px) { .disparity { grid-template-columns: 1fr 1fr; } }
.disparity-col { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.disparity-col header { padding: .55rem .9rem; font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.col-live header { background: var(--color-live); }
.col-proto header { background: var(--color-proto); }
.disparity-col .body { padding: 1rem; font-size: .95rem; }
.disparity-col ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.disparity-col li { margin-bottom: .35rem; }

/* ---------- Screenshot / figure placeholder ---------------------------- */
.shot {
  border: 2px dashed #b6c2d4; border-radius: var(--radius); background:
    repeating-linear-gradient(45deg, #f4f7fb, #f4f7fb 12px, #eef2f8 12px, #eef2f8 24px);
  min-height: 150px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--color-muted); font-size: .85rem; padding: 1.25rem; margin: 0;
}
figure { margin: 1.2rem 0; }
figcaption { font-size: .82rem; color: var(--color-muted); margin-top: .5rem; }

/* ---------- Callout (algorithmic relevance) ---------------------------- */
.callout {
  border-left: 5px solid var(--color-accent); background: var(--color-light);
  padding: 1.2rem 1.3rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.6rem 0;
}
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.comparison-box { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.2rem 1.3rem; background: var(--color-light); margin: 1.4rem 0; }

/* ---------- Flow: the compounding chain -------------------------------- */
.flow { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.3rem 0; padding: 0; list-style: none; counter-reset: flow; }
.flow li { flex: 1 1 150px; border: 1px solid var(--color-border); border-top: 3px solid var(--color-accent); border-radius: var(--radius); padding: .7rem .85rem; background: #fff; }
.flow li b { display: block; color: var(--color-primary); margin-bottom: .15rem; }
.flow li span { font-size: .82rem; color: #46546a; }

/* ---------- Choose-your-path entry cards ------------------------------- */
.choices { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.4rem 0; }
@media (min-width: 680px) { .choices { grid-template-columns: repeat(2, 1fr); } }
.choice { border: 1px solid var(--color-border); border-left: 4px solid var(--color-secondary); border-radius: var(--radius); padding: 1rem 1.15rem; background: #fff; }
.choice:hover { border-color: var(--color-secondary); box-shadow: var(--shadow); }
.choice h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.choice p { margin: 0; font-size: .95rem; }
.choice a { font-weight: 600; }
.step-num {
  display: inline-flex; width: 1.65rem; height: 1.65rem; border-radius: 50%;
  background: var(--color-accent); color: #fff; font-weight: 800; font-size: .85rem;
  align-items: center; justify-content: center; margin-right: .55rem; vertical-align: -3px;
}

/* ---------- Home hero with banner art ---------------------------------- */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2.2rem; align-items: center; }
@media (min-width: 820px) { .hero-grid { grid-template-columns: 1.45fr 1fr; } }
.hero-art { width: 100%; max-width: 430px; justify-self: center; display: block; }
@media (max-width: 819px) { .hero-art { max-width: 300px; } }
img.hero-art { height: auto; border-radius: 10px; background: #fff; box-shadow: 0 14px 36px rgba(0,0,0,.28); }

/* ---------- Metrics ---------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin: 1.4rem 0; }
@media (min-width: 680px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metric { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem; text-align: center; background: #fff; }
.metric-num { font-size: 1.7rem; font-weight: 800; color: var(--color-primary); line-height: 1.1; }
.metric-label { font-size: .78rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .3rem; }

/* ---------- Tags ------------------------------------------------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.tag { font-size: .76rem; font-weight: 600; background: #edf2f7; color: #3a4a61; border: 1px solid var(--color-border); border-radius: 999px; padding: .2rem .7rem; }
a.tag { text-decoration: none; }
a.tag:hover { background: #fff; border-color: var(--color-secondary); color: var(--color-primary); }

/* ---------- "Continue the case study" contextual links ----------------- */
.reads { border-top: 2px solid var(--color-border); margin-top: 2.4rem; padding-top: 1.4rem; }
.reads h2 { margin-top: 0; }
.reads p { max-width: 68ch; }
.reads a { font-weight: 600; }

.note { font-size: .85rem; color: var(--color-muted); background: #fffaf3; border: 1px dashed #e3b888; border-radius: var(--radius); padding: .6rem .85rem; margin: 1rem 0; }

/* ---------- Portfolio home -------------------------------------------- */
.home-hero { background: linear-gradient(160deg, var(--color-primary), #122644); color: #fff; padding: 3.4rem 0 3rem; }
.home-hero .eyebrow { color: #f6ad55; }
.home-hero h1 { color: #fff; max-width: 18ch; }
.home-hero .lead { color: #cdd8e6; }
.home-section { padding: 2.6rem 0; border-bottom: 1px solid var(--color-border); }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.skill { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.1rem; background: #fff; }
.skill h3 { color: var(--color-accent); font-size: 1rem; }
.skill p { margin: 0; font-size: .92rem; color: #46546a; }

.project-card {
  display: grid; grid-template-columns: 1fr; gap: 1.2rem; border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff;
}
@media (min-width: 820px) { .project-card { grid-template-columns: 1.1fr 1fr; align-items: stretch; } }
.project-card .pc-media { background: var(--color-primary); color: #fff; padding: 1.6rem; display: flex; flex-direction: column; justify-content: center; }
.project-card .pc-media .metrics { grid-template-columns: 1fr 1fr; }
.project-card .pc-media .metric { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); }
.project-card .pc-media .metric-num { color: #fff; }
.project-card .pc-media .metric-label { color: #b9c6d8; }
.project-card .pc-body { padding: 1.6rem; }
.project-card .pc-body h3 { font-size: 1.4rem; }

/* ---------- Footer ----------------------------------------------------- */
.cs-footer { background: var(--color-light); border-top: 1px solid var(--color-border); padding: 2rem 0; margin-top: 2rem; font-size: .9rem; color: #46546a; }
.cs-footer a { color: var(--color-secondary); }
.cs-footer .container { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: space-between; align-items: center; }
