/* ==========================================================================
   InventHelp — Site 9
   Bento system · modular tiles on a cool neutral ground
   Geometric sans + mono labels · rounded panels · pastel section fills
   ========================================================================== */

/* --- 1. Reset ------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body,
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dt, dd, li {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
}

a { color: inherit; }

/* --- 2. Tokens ----------------------------------------------------------- */

:root {
  /* ground and surfaces */
  --ground:    #eceef1;
  --ground-2:  #e2e5ea;
  --tile:      #ffffff;
  --edge:      #dcdfe5;
  --edge-soft: #e8eaee;

  /* ink */
  --ink:       #14161b;
  --ink-2:     #3b414c;
  --ink-3:     #666d79;

  /* accents */
  --indigo:    #3f36c9;
  --indigo-d:  #2a238f;
  --rust:      #b34a10;
  --teal:      #0d6f5c;

  /* pastel tile fills */
  --fill-lilac:  #e7e4f8;
  --fill-mint:   #ddeee6;
  --fill-sand:   #fbe7d6;
  --fill-sky:    #dde8f7;

  --sans:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --display: 'Space Grotesk', 'DM Sans', Arial, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --shell:   70rem;
  --gutter:  1.5rem;
  --gap:     1.15rem;
  --pad:     2.1rem;
  --radius:  22px;
  --radius-s: 14px;

  --t-1:  0.74rem;
  --t0:   1.055rem;
  --t1:   1.22rem;
  --t2:   1.5rem;
  --t3:   1.95rem;
  --t4:   2.85rem;
}

/* --- 3. Base ------------------------------------------------------------- */

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t0);
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: -0.003em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 1px;
}

::selection { background: var(--indigo); color: #fff; }

a {
  color: var(--indigo-d);
  text-decoration: none;
  box-shadow: inset 0 -1px 0 0 rgba(63, 54, 201, 0.42);
}

a:hover {
  color: var(--rust);
  box-shadow: inset 0 -2px 0 0 rgba(179, 74, 16, 0.5);
}

a:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 3px;
  box-shadow: none;
}

strong { font-weight: 700; }

/* --- 4. Shell and grid --------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.span-4  { grid-column: span 4; }
.span-5  { grid-column: span 5; }
.span-6  { grid-column: span 6; }
.span-7  { grid-column: span 7; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.tile {
  background: var(--tile);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: var(--pad);
  min-width: 0;
}

.tile--flush { padding: 0; overflow: hidden; }

.tile--lilac { background: var(--fill-lilac); border-color: #d7d2f0; }
.tile--mint  { background: var(--fill-mint);  border-color: #cae3d7; }
.tile--sand  { background: var(--fill-sand);  border-color: #f2d7c1; }
.tile--sky   { background: var(--fill-sky);   border-color: #cddcf1; }

/* --- 5. Header ----------------------------------------------------------- */

.site-header { padding: var(--gap) 0 0; }

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  background: var(--tile);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 0.95rem 1.5rem;
}

.brand {
  box-shadow: none;
  line-height: 0;
  flex: 0 0 auto;
}

.brand:hover { box-shadow: none; }

.brand img { width: 196px; height: auto; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.45rem;
}

.site-nav a {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--t-1);
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: var(--ground);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.42em 0.95em;
  box-shadow: none;
}

.site-nav a:hover {
  color: var(--indigo-d);
  background: var(--fill-lilac);
  box-shadow: none;
}

.site-nav a[aria-current='page'] {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

/* --- 6. Title tile ------------------------------------------------------- */

main { padding-top: var(--gap); }

.tile--title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.6rem var(--pad);
}

.kicker {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--indigo-d);
  background: var(--fill-lilac);
  border-radius: 999px;
  padding: 0.35em 0.85em;
  margin-bottom: 1.35rem;
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t4);
  line-height: 1.08;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.standfirst {
  font-size: var(--t1);
  line-height: 1.52;
  color: var(--ink-2);
  margin-top: 1.25rem;
  max-width: 46ch;
}

.byline {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-top: 1.9rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--edge);
}

/* --- 7. Figures ---------------------------------------------------------- */

.figure { margin: 0; }

.frame {
  width: 100%;
  overflow: hidden;
  background: var(--ground-2);
  border-radius: var(--radius);
}

.tile--flush .frame { border-radius: 0; }

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ar-32  { aspect-ratio: 3 / 2; }
.ar-43  { aspect-ratio: 4 / 3; }
.ar-169 { aspect-ratio: 16 / 9; }
.ar-34  { aspect-ratio: 3 / 4; }
.ar-23  { aspect-ratio: 2 / 3; }
.ar-11  { aspect-ratio: 1 / 1; }

.figure figcaption,
.tile--flush figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  padding: 0.9rem 1.3rem 1.1rem;
}

.figure > figcaption { padding-left: 0; padding-right: 0; }

/* --- 8. Prose tiles ------------------------------------------------------ */

.prose > p { margin-bottom: 1.15rem; }

.prose > p:last-child { margin-bottom: 0; }

.prose--wide > p,
.prose--wide > h2,
.prose--wide > .eyebrow { max-width: 64ch; }

.lead {
  font-size: var(--t1);
  line-height: 1.6;
  color: var(--ink);
  letter-spacing: -0.011em;
}

.eyebrow {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.7rem;
}

.prose > h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t3);
  line-height: 1.16;
  letter-spacing: -0.022em;
  margin-bottom: 1.05rem;
  text-wrap: balance;
}

.prose > h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t2);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 1.9rem 0 0.75rem;
}

.prose ul { margin: 0 0 1.3rem; }

.prose ul li {
  position: relative;
  padding-left: 1.55rem;
  margin-bottom: 0.6rem;
  max-width: 62ch;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 0.6rem;
  height: 0.6rem;
  border: 2px solid var(--indigo);
  border-radius: 3px;
}

/* Definition tile */

.deflist dt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-top: 1.05rem;
}

.deflist dt:first-of-type { margin-top: 0; }

.deflist dd {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin-top: 0.2rem;
}

.tile-label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 0.85rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid rgba(20, 22, 27, 0.14);
}

/* --- 9. Pull quotes ------------------------------------------------------ */

.pullquote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.3rem var(--pad);
}

.pullquote p {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t2);
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 44ch;
  text-wrap: balance;
}

.pullquote .attrib {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 1.15rem;
}

/* --- 10. Closing tile ---------------------------------------------------- */

.closing {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t1);
  line-height: 1.45;
  letter-spacing: -0.018em;
  color: var(--ink);
  max-width: 58ch;
}

.endnote {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--edge);
}

/* --- 11. Footer ---------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: #d3d6dc;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-top: 0.6rem;
  padding: 2.6rem 0 2.2rem;
}

.site-footer a { color: #eceef1; box-shadow: none; }

.site-footer a:hover { color: #fff; box-shadow: inset 0 -1px 0 0 rgba(255, 255, 255, 0.55); }

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  padding-bottom: 1.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-mark {
  line-height: 0;
  box-shadow: none;
  background: #fff;
  border-radius: var(--radius-s);
  padding: 0.6rem 0.9rem;
}

.footer-mark:hover { box-shadow: none; }

.footer-mark img { width: 168px; height: auto; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
}

.footer-nav a {
  font-family: var(--mono);
  font-size: var(--t-1);
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.4em 0.9em;
}

.footer-nav a:hover { background: rgba(255, 255, 255, 0.18); box-shadow: none; }

/* Injected link columns */

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 2.4rem;
  padding: 2.1rem 0 1.9rem;
}

.footer-cols h2 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  padding-bottom: 0.8rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-cols ul li { margin-bottom: 0.48rem; }

.footer-cols a {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #b9bec8;
  box-shadow: none;
}

.footer-cols a:hover { color: #fff; box-shadow: none; text-decoration: underline; }

.copyright {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #9aa0ac;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 1.4rem;
}

/* --- 12. Responsive ------------------------------------------------------ */

@media (max-width: 900px) {
  :root {
    --t4: 2.3rem;
    --t3: 1.72rem;
    --t2: 1.35rem;
    --pad: 1.7rem;
    --gap: 0.95rem;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 { grid-column: span 12; }

  .tile--half { grid-column: span 6; }

  .tile--title { padding: 2.1rem var(--pad); }

  .standfirst { max-width: none; }

  .ar-34 { aspect-ratio: 4 / 3; }
  .ar-23 { aspect-ratio: 3 / 2; }

  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root {
    --t0: 1.01rem;
    --t4: 1.95rem;
    --t3: 1.5rem;
    --t2: 1.24rem;
    --t1: 1.11rem;
    --gutter: 1rem;
    --pad: 1.35rem;
    --radius: 18px;
  }

  body { line-height: 1.68; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
  }

  .brand img { width: 168px; }

  .site-nav a { font-size: 0.7rem; padding: 0.38em 0.8em; }

  .tile--half { grid-column: span 12; }

  .ar-32,
  .ar-169 { aspect-ratio: 3 / 2; }

  .ar-34,
  .ar-23 { aspect-ratio: 4 / 3; }

  .pullquote { padding: 1.7rem var(--pad); }

  .footer-top { flex-direction: column; align-items: flex-start; }

  .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
}

/* --- 13. Motion and print ------------------------------------------------ */

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

@media print {
  .site-nav,
  .site-footer { display: none; }

  body { background: #fff; }

  .tile { border: 0; padding: 0; background: none; }
}
