/* ==========================================================================
   Production Times — case study
   --------------------------------------------------------------------------
   Rewritten to match ontarioTechRacing.css so the two case studies read as
   one system. Removed: the dead .navbar / #siteNav / .tag / .button blocks
   (none of those classes exist in the markup), and three duplicate nav
   implementations that were fighting each other.

   TOKENS below are shared with styles.css and ontarioTechRacing.css.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700&family=Inter:wght@400;500;600&display=swap');

/* --------------------------------------------------------------------------
   TOKENS
   -------------------------------------------------------------------------- */
:root{
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --paper:      #FCFCFD;
  --surface:    #FFFFFF;
  --ink:        #15171C;
  --ink-2:      #4A5160;
  --ink-3:      #6B7280;
  --line:       #E3E6EC;
  --line-strong:#CBD1DC;

  --accent:     #2447B8;
  --accent-200: #C6D2F1;
  --accent-50:  #EEF2FD;

  --warm:       #A85F1E;
  --warm-50:    #FDF4E9;

  --s1: .25rem; --s2: .5rem;  --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem;   --s7: 3rem;   --s8: 4rem;

  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-pill: 999px;

  --dur: 180ms;
  --dur-slow: 280ms;
  --ease: cubic-bezier(.2,.8,.2,1);

  --measure: 70ch;
  --page: 960px;
}

/* --------------------------------------------------------------------------
   RESET + BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after{ box-sizing: border-box; }

html{ background: var(--paper); -webkit-text-size-adjust: 100%; }

body{
  /* The blue gradient used to run down the whole page, which made every
     screenshot sit on tinted paper. It now lives in .header-banner only,
     matching the racing case study. */
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea{ font: inherit; color: inherit; }
img{ max-width: 100%; height: auto; display: block; }
figure{ margin: 0; }
p{ margin: 0; }
a{ color: var(--accent); }

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

h1, h2, h3, h4{
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h1{ font-size: clamp(1.85rem, 4.5vw, 2.4rem); }
h2{ font-size: 1.55rem; letter-spacing: -0.02em; }
h3{ font-size: 1.05rem; }

section > h2{
  position: relative;
  padding-bottom: var(--s3);
  margin-bottom: var(--s4);
}
section > h2::after{
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

section p{ color: var(--ink-2); max-width: var(--measure); }
section p + p{ margin-top: var(--s3); }

ul{ margin: var(--s3) 0 0; padding-left: 1.25rem; color: var(--ink-2); }
li{ margin-bottom: var(--s2); max-width: var(--measure); }
li::marker{ color: var(--accent-200); }
li strong{ color: var(--ink); }

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.header-banner{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252,252,253,.88);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-nav{
  position: relative;
  z-index: 10;
  max-width: var(--page);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: transparent;
}

.site-nav .brand{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.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;
}

.nav-toggle{
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle .bar{
  display: block;
  width: 20px; height: 2px;
  margin: 2.5px 0;
  background: var(--ink);
  border-radius: 2px;
}

.nav-list{
  display: flex;
  align-items: center;
  gap: var(--s5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list li{ margin: 0; }

.nav-list a{
  position: relative;
  display: inline-block;
  color: var(--ink-2);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  white-space: nowrap;
  padding: .2rem 0;
  transition: color var(--dur) var(--ease);
}
.nav-list a::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav-list a:hover{ color: var(--accent); }
.nav-list a:hover::after{ transform: scaleX(1); }
.nav-list a[aria-current="page"]{ color: var(--accent); }
.nav-list a[aria-current="page"]::after{ transform: scaleX(1); }
.nav-resume{
  padding: .45rem .75rem !important;
  color: var(--ink) !important;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
}
.nav-resume::after{ display: none; }
.nav-resume:hover{ border-color: var(--accent); background: var(--accent-50); }

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
main{
  /* was: padding-inline/padding-block, then a `padding: 2rem` shorthand two
     lines later that wiped both. Also had overflow:hidden, which clipped the
     hover scale on every image that touched the container edge. */
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s8);
}

section{ margin-top: var(--s8); }
main > section:first-child{ margin-top: 0; }

/* .intro and .problem had margin:30px, which pushed them out of alignment
   with every other section. They sit on the same grid now. */
.intro, .problem{ margin-left: 0; margin-right: 0; }

/* --------------------------------------------------------------------------
   HERO + INTRO
   -------------------------------------------------------------------------- */
.hero{ margin: 0 0 var(--s7); }
.hero img,
.hero-img{
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
}

.intro h1{ margin-bottom: var(--s3); }

/* "Demoed" is a status, not a heading — pill instead of h3 styling. */
.intro h3{
  display: inline-block;
  margin-bottom: var(--s5);
  padding: .2rem .7rem;
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--accent);
  background: var(--accent-50);
  border: 1px solid var(--accent-200);
  border-radius: var(--r-pill);
}

.context-text .subtitle{
  font-size: 1.0625rem;
  color: var(--ink-2);
  max-width: var(--measure);
}
.context-text b{ color: var(--ink); }

/* Four facts stacked in a single column and ran the full page width. They
   now sit in a row that wraps. */
.quick-facts{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s3);
  margin-top: var(--s5);
}
.quick-facts div{
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r);
  font-size: .875rem;
  color: var(--ink-2);
  transition: border-left-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.quick-facts div strong{ color: var(--ink); }
.quick-facts div:hover{
  border-left-color: var(--accent);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   PROBLEM CARDS
   -------------------------------------------------------------------------- */
.problem-cards{
  /* was display:flex with no wrap — three cards crushed together on mobile */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s4);
  margin-top: var(--s5);
}

.card{
  margin: 0;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* markup uses <h3> in the cards now, not <h2> */
.card h3{
  margin: 0 0 var(--s1);
  color: var(--accent);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.card p{
  margin: 0;
  font-size: .875rem;
  color: var(--ink-3);
  max-width: none;
}
.card:hover{
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

/* --------------------------------------------------------------------------
   IMAGE GROUPS
   -------------------------------------------------------------------------- */

/* Three children at width:40% each came to 120% and overflowed the row. */
.initial-design-container{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s4);
  margin-top: var(--s5);
}
.inital-design{ width: 100%; }

/* The iteration screenshots used to be <img> children of a <ul>. */
.iteration-images{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s4);
  margin-top: var(--s4);
}

.final-designs{ display: grid; gap: var(--s5); }

.design-process img,
.feedback img,
.iteration-images img,
.shipped img,
.final-designs img,
.initial-design-container img{
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--line);
  transition: transform var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease);
}
.design-process img:hover,
.feedback img:hover,
.iteration-images img:hover,
.final-designs img:hover,
.initial-design-container img:hover{
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(21,23,28,.10);
}

.feedback figure{ margin-top: var(--s5); }

figcaption,
.caption{
  margin-top: var(--s2);
  text-align: center;
  color: var(--ink-3);
  font-size: .8125rem;
  line-height: 1.5;
}

.shipped .grid{ margin-top: var(--s4); }
.shipped h3{ margin-bottom: var(--s2); }

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
footer{
  text-align: center;
  padding: var(--s7) var(--s5);
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: .875rem;
  margin-top: var(--s8);
}
footer .microcopy{ margin-bottom: var(--s1); }

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 700px){
  main{ padding: var(--s5) var(--s4) var(--s7); }
  section{ margin-top: var(--s7); }

  .nav-toggle{ display: inline-flex; }

  #siteMenu{
    position: absolute;
    left: 0; right: 0; top: 100%;
    z-index: 1000;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--s2) var(--s4) var(--s3);
  }
  .nav-list{ flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list a{ display: block; padding: .65rem .5rem; border-radius: var(--r-sm); }
  .nav-list a::after{ display: none; }
  .nav-list a:hover{ background: var(--accent-50); }
}

/* Pre-existing bug: the toggle script sets menu.hidden = true on every page
   load, but .nav-toggle is display:none above 700px — so the case-study nav
   was unreachable on desktop. Overridden explicitly per width. */
@media (min-width: 701px){
  #siteMenu[hidden]{ display: block; }
}
@media (max-width: 700px){
  #siteMenu[hidden]{ display: none; }
}

/* --------------------------------------------------------------------------
   MOTION / ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
