/* Good Tech Institute — design tokens and site styles
   Palette: Pure Monochrome (specification section 02)
   Type: IBM Plex Sans + IBM Plex Serif (specification section 03, free alternative)
   All fonts are self-hosted. No external requests are made by this stylesheet. */

/* ---------- Fonts (Latin-1 subsets, WOFF2, SIL OFL 1.1) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexSerif-Regular-Latin1.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  /* Colour (section 02) */
  --c-page: #FAFAFA;
  --c-white: #FFFFFF;
  --c-panel: #E6E8EB;
  --c-ink: #17191C;
  --c-primary: #282C31;
  --c-primary-hover: #17191C;
  --c-silver: #B8BEC6;
  --c-muted: #5F6770;
  --c-divider: #D5D8DC;

  /* Type (section 03) */
  --f-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;

  /* Hero heading: 72–88 px desktop, 40–48 px mobile */
  --fs-hero: clamp(2.5rem, 1.5rem + 4.5vw, 5rem);
  /* Section heading: 40–48 px desktop, 28–34 px mobile */
  --fs-section: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  /* Subheading: 24–28 px desktop, 22–24 px mobile */
  --fs-sub: clamp(1.375rem, 1.25rem + 0.5vw, 1.625rem);
  /* Introductory text: 21–23 px desktop, 19–20 px mobile */
  --fs-intro: clamp(1.1875rem, 1.125rem + 0.35vw, 1.375rem);
  /* Body text: 18–19 px desktop, 17–18 px mobile */
  --fs-body: clamp(1.0625rem, 1.03rem + 0.15vw, 1.1875rem);
  /* Navigation and controls: 15–16 px desktop, 16 px mobile */
  --fs-nav: 1rem;
  /* Captions and labels: 13–14 px */
  --fs-caption: 0.875rem;

  /* Layout (section 03) */
  --max-w: 1280px;
  --gutter: 24px;           /* mobile 20–24 px */
  --section-gap: 64px;      /* mobile 56–72 px */
  --measure: 66ch;          /* 60–70 characters per line */
  --radius: 4px;            /* buttons 4–6 px */
  --control-h: 48px;        /* at least 48 px tall */
  --t: 180ms;               /* 150–200 ms colour transitions */
}
@media (min-width: 768px) {
  :root { --gutter: 32px; --section-gap: 88px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 64px; --section-gap: 112px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  background: var(--c-page);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: 100%;
  line-height: 1.6;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: var(--fs-body);
  overflow-x: hidden;
}
main { flex: 1 0 auto; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-weight: 500; margin: 0; overflow-wrap: anywhere; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
address { font-style: normal; }
::selection { background: var(--c-ink); color: var(--c-white); }

/* Links: underlined by default (section 03) */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--t) ease, text-decoration-color var(--t) ease;
}
a:hover { text-decoration-thickness: 2px; }

/* Focus: ink outline on light surfaces, white on dark (section 13) */
:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
}
.on-dark :focus-visible,
.on-dark:focus-visible {
  outline-color: var(--c-white);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}
.measure { max-width: var(--measure); }
.stack > * + * { margin-top: 1em; }
.stack-lg > * + * { margin-top: 2rem; }

/* ---------- Typography scale ---------- */
.t-hero {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 1.05;          /* 1.02–1.08 */
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.t-section {
  font-size: var(--fs-section);
  font-weight: 500;
  line-height: 1.14;          /* 1.1–1.18 */
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.t-sub {
  font-size: var(--fs-sub);
  font-weight: 500;
  line-height: 1.3;
}
.t-intro {
  font-size: var(--fs-intro);
  line-height: 1.5;
}
.t-body { font-size: var(--fs-body); line-height: 1.6; }
.t-caption {
  font-size: var(--fs-caption);
  line-height: 1.45;
  color: var(--c-muted);
}
.t-muted { color: var(--c-muted); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--c-ink);
  color: var(--c-white);
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 16px; outline-color: var(--c-ink); }

/* ---------- Header ---------- */
.site-header {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-divider);
  position: relative;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 80px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
/* Compact two-line wordmark for narrow headers (section 03) */
.wordmark .wm-break { display: none; }
@media (max-width: 379px) {
  .wordmark { white-space: normal; font-size: 1.125rem; }
  .wordmark .wm-break { display: block; }
}

.site-nav { display: none; }
.site-nav ul { list-style: none; display: flex; align-items: center; gap: 28px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  font-size: var(--fs-nav);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color var(--t) ease;
}
.site-nav a:hover { border-bottom-color: var(--c-ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--c-ink); }
.site-nav .nav-cta { margin-left: 8px; }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--control-h);
  min-width: var(--control-h);
  padding: 0 14px;
  background: var(--c-white);
  color: var(--c-ink);
  border: 1px solid var(--c-muted);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--fs-nav);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t) ease, color var(--t) ease, border-color var(--t) ease;
}
.menu-toggle:hover { background: var(--c-panel); }
.menu-toggle[aria-expanded="true"] { background: var(--c-panel); }
.menu-toggle .icon { width: 20px; height: 14px; position: relative; }
.menu-toggle .icon span {
  position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 1px;
  transition: transform var(--t) ease, opacity var(--t) ease;
}
.menu-toggle .icon span:nth-child(1) { top: 0; }
.menu-toggle .icon span:nth-child(2) { top: 6px; }
.menu-toggle .icon span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded="true"] .icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .icon span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile menu: all six main destinations in a vertical list (section 06) */
.mobile-menu {
  display: none;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-divider);
}
.mobile-menu[data-open="true"] { display: block; }
.mobile-menu ul { list-style: none; padding-block: 8px 16px; }
.mobile-menu li + li { border-top: 1px solid var(--c-divider); }
.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 0;
  font-size: 1.125rem;
  font-weight: 500;
  text-decoration: none;
}
.mobile-menu a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.2em; }

@media (min-width: 1024px) {
  .site-nav { display: block; }
  .menu-toggle, .mobile-menu { display: none !important; }
}

/* ---------- Buttons (section 02 interaction states, section 03) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--control-h);
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: var(--fs-nav);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t) ease, color var(--t) ease, border-color var(--t) ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--c-primary);
  color: var(--c-white);
  border-color: var(--c-primary);
}
.btn-primary:hover, .btn-primary:active {
  background: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
}
.btn-secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-muted);
}
.btn-secondary:hover, .btn-secondary:active {
  background: var(--c-panel);
  border-color: var(--c-ink);
}
/* Buttons on dark surfaces */
.on-dark .btn-primary {
  background: var(--c-white);
  color: var(--c-ink);
  border-color: var(--c-white);
}
.on-dark .btn-primary:hover { background: var(--c-panel); border-color: var(--c-panel); }
.on-dark .btn-secondary { color: var(--c-white); border-color: var(--c-silver); }
.on-dark .btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--c-white); }

.btn .arrow { width: 18px; height: 18px; flex: none; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}
@media (max-width: 767px) {
  .actions .btn { flex: 1 1 100%; }      /* full-width primary buttons where useful */
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-gap); }
.section + .section { padding-top: 0; }
.section-panel { background: var(--c-panel); }
.section-white { background: var(--c-white); }
.section-panel + .section, .section-white + .section, .section + .section-panel, .section + .section-white { padding-top: var(--section-gap); }
.section-head { margin-bottom: 40px; }
.section-head .t-intro { margin-top: 16px; }
.section-ink {
  background: var(--c-ink);
  color: var(--c-white);
}
.section-ink .t-muted { color: var(--c-silver); }
.section-ink a { color: var(--c-white); }

.divider { border: 0; border-top: 1px solid var(--c-divider); margin: 0; }

/* ---------- Hero (section 05) ---------- */
.hero { padding-block: 56px var(--section-gap); }
.hero .grid { row-gap: 40px; }
.hero-text { grid-column: 1 / -1; }
.hero-text .t-hero { margin-bottom: 28px; }
.hero-text .t-sub { margin-bottom: 20px; }
.hero-text .stack { margin-bottom: 32px; }
.hero-media { grid-column: 1 / -1; margin: 0; }
.hero-media .media-field {
  background: var(--c-ink);
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 4 / 5;             /* mobile: portrait composition */
  max-height: 45vh;                /* mobile: artwork capped at about 45% of screen height */
  margin-inline: auto;
}
@media (min-width: 768px) {
  .hero-media .media-field { aspect-ratio: 5 / 4; max-height: none; }
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1024px) {
  .hero { padding-block: 96px var(--section-gap); }
  .hero-text { grid-column: 1 / span 7; align-self: center; }   /* text ~7 columns */
  .hero-media { grid-column: 8 / span 5; align-self: center; }  /* image ~5 columns */
  .hero-media .media-field { max-height: none; aspect-ratio: 5 / 4; }
}
.hero-nav-text { font-size: var(--fs-body); }

/* ---------- Numbered explanatory rows (section 05: "numbered explanatory rows") ---------- */
.rows { list-style: none; counter-reset: row; border-top: 1px solid var(--c-divider); }
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 32px;
  padding-block: 32px;
  border-bottom: 1px solid var(--c-divider);
}
.row-num {
  font-weight: 500;
  font-size: var(--fs-sub);
  line-height: 1;
  color: var(--c-muted);
}
.row-body h3 { font-size: var(--fs-sub); margin-bottom: 12px; }
.row-body .stack { max-width: var(--measure); }
@media (min-width: 768px) {
  .row { grid-template-columns: 72px minmax(0, 1fr); padding-block: 40px; }
  .row-num { padding-top: 6px; }
}

/* ---------- Definition blocks (research page properties) ---------- */
.defs { display: grid; gap: 32px; }
.def { padding-top: 24px; border-top: 1px solid var(--c-divider); }
.def h2 { font-size: var(--fs-sub); margin-bottom: 12px; }
.def p { max-width: var(--measure); }
@media (min-width: 768px) {
  .defs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
}

/* ---------- Plain bullet lists ---------- */
.bullets { list-style: none; max-width: var(--measure); }
.bullets li { position: relative; padding-left: 28px; }
.bullets li + li { margin-top: 14px; }
.bullets li::before {
  content: "";
  position: absolute; left: 4px; top: 0.72em;
  width: 10px; height: 2px;
  background: var(--c-ink);
}

/* ---------- Evidence disclosure (section 12) ---------- */
.evidence {
  margin-top: 12px;
  max-width: var(--measure);
  font-size: var(--fs-caption);
  color: var(--c-muted);
}
.evidence summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: var(--c-muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.evidence summary::-webkit-details-marker { display: none; }
.evidence summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--t) ease;
  flex: none;
}
.evidence[open] summary::before { transform: rotate(45deg); }
.evidence ul { list-style: none; margin-top: 8px; padding-left: 15px; border-left: 2px solid var(--c-divider); }
.evidence li + li { margin-top: 6px; }
.evidence a { color: var(--c-ink); }

/* ---------- Sources list (page end, unnumbered) ---------- */
.sources { border-top: 1px solid var(--c-divider); padding-top: 40px; }
.sources h2 { font-size: var(--fs-sub); margin-bottom: 16px; }
.sources p { max-width: var(--measure); color: var(--c-muted); font-size: var(--fs-caption); margin-bottom: 16px; }
.sources ul { list-style: none; max-width: var(--measure); }
.sources li + li { margin-top: 10px; }

/* ---------- Contact (sections 12 + 13: single-column layout for contact addresses) ---------- */
.contact-list { display: grid; gap: 0; border-top: 1px solid var(--c-divider); }
.contact-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 48px;
  padding-block: 40px;
  border-bottom: 1px solid var(--c-divider);
}
.contact-card h2, .contact-card h3 { font-size: var(--fs-sub); margin-bottom: 8px; }
.contact-text p { max-width: var(--measure); }
.contact-card .email-block { margin-top: 8px; }
@media (min-width: 1024px) {
  .contact-card { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding-block: 48px; }
  .contact-card .email-block { margin-top: 0; }
}
.email-block { margin-top: 24px; }
.email-address {
  display: inline-block;
  font-size: var(--fs-intro);
  font-weight: 500;
  overflow-wrap: anywhere;
  margin-bottom: 16px;
}
.email-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.copy-status {
  margin-top: 12px;
  font-size: var(--fs-caption);
  color: var(--c-muted);
  min-height: 1.5em;
}
.copy-status[data-state="ok"]::before { content: "\2713\00a0"; }   /* explicit icon alongside the label */
.copy-status[data-state="fail"]::before { content: "\2717\00a0"; }

/* ---------- Closing invitation ---------- */
.closing { padding-block: var(--section-gap); }
.closing .t-section { margin-bottom: 20px; }
.closing .t-hero { margin-bottom: 28px; max-width: 14ch; }
.closing .measure { margin-bottom: 32px; }

/* ---------- Footer (section 12) ---------- */
.site-footer {
  background: var(--c-ink);
  color: var(--c-white);
  padding-block: 56px 40px;
  margin-top: auto;
}
.site-footer .wrap { display: grid; gap: 32px; }
.footer-brand .name { font-weight: 500; font-size: 1.25rem; line-height: 1.2; }
.footer-brand .line { font-family: var(--f-serif); color: var(--c-silver); margin-top: 6px; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 40px; font-size: var(--fs-nav); font-weight: 500; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--c-silver); font-size: var(--fs-caption); padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.14); }
.footer-meta a { color: var(--c-white); }
@media (min-width: 1024px) {
  .site-footer .wrap { grid-template-columns: 1fr 1fr; align-items: start; }
  .footer-meta { grid-column: 1 / -1; }
}

/* ---------- Page header for inner pages ---------- */
.page-head { padding-block: 56px 40px; }
.page-head .t-section { margin-bottom: 20px; }
.page-head .t-hero { margin-bottom: 20px; }
@media (min-width: 1024px) { .page-head { padding-block: 88px 56px; } }
.page-head + .section { padding-top: 0; }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .menu-toggle, .mobile-menu, .skip-link { display: none !important; }
  a { text-decoration: none; }
  .evidence { display: block; }
  .evidence summary { display: none; }
}
