/* ==========================================================================
   TPP Technology — design system
   A ground-up stylesheet for the 2026 redesign. No Bootstrap, no template
   classes: the old ud-* system fought every layout decision.

   Principles applied (from Apple's HIG guidance + Emil Kowalski's motion rules)
   - System font stack: it ships optical sizing and tracking tables already
   - Tracking is size-specific: tight on display type, ~0 on body
   - One accent colour, used sparingly; structure carried by type and space
   - Motion under 300ms for hover/press, ease-out curves, never ease-in
   - Press feedback on every pressable element
   - Reduced motion drops movement but keeps opacity
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  --ink: #1d1d1f;          /* primary text */
  --ink-2: #6e6e73;        /* secondary text */
  --ink-3: #86868b;        /* tertiary / captions */
  --surface: #ffffff;
  --surface-2: #f5f5f7;    /* alternating section band */
  --surface-dark: #0b0f10;
  --line: #d2d2d7;
  --accent: #0a8f7b;
  --accent-bright: #00e5b0;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-press: 140ms;
  --dur-hover: 220ms;
  --dur-enter: 500ms;

  --page: 1120px;          /* full layout width  */
  --measure: 720px;        /* comfortable text measure */
  --gap: 24px;
  --band: clamp(56px, 7vw, 92px);   /* vertical rhythm; adjacent sections stack two of these */
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.53;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ----------------------------------------------------------- typography -- */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.022em;   /* tighten as size grows */
  line-height: 1.07;
  color: var(--ink);
}

.display {
  font-size: clamp(40px, 6.4vw, 80px);
  letter-spacing: -0.028em;
  line-height: 1.05;
  font-weight: 600;
}

.headline {
  font-size: clamp(32px, 4.2vw, 52px);
  letter-spacing: -0.024em;
  line-height: 1.08;
}

.title {
  font-size: clamp(22px, 2.2vw, 27px);
  letter-spacing: -0.018em;
  line-height: 1.2;
}

.lede {
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.42;
  letter-spacing: 0.004em;
  color: var(--ink-2);
  margin: 20px 0 0;
}

.body { margin: 16px 0 0; color: var(--ink-2); }

.eyebrow {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.caption {
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-3);
}

/* --------------------------------------------------------------- layout -- */
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 22px;
}
.wrap--narrow { max-width: var(--measure); }

.section { padding-block: var(--band); }
.section--tint { background: var(--surface-2); }
.section--dark { background: var(--surface-dark); color: #f5f5f7; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .lede, .section--dark .body { color: #a1a1a6; }

.center { text-align: center; }
.center .lede { margin-inline: auto; max-width: 640px; }
.center + .wrap { margin-top: 40px; }

.stack > * + * { margin-top: 18px; }

/* --------------------------------------------------------------- header -- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 52px;
}
.masthead__brand {
  display: flex;
  align-items: center;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.masthead__brand span { color: var(--accent); font-weight: 500; margin-left: 7px; letter-spacing: 0.06em; font-size: 12px; text-transform: uppercase; }

.nav { display: flex; gap: 30px; margin-left: auto; }
.nav a {
  position: relative;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.86;
  transition: opacity var(--dur-hover) var(--ease-out);
}
.nav a[aria-current="page"] { opacity: 1; font-weight: 500; }

.masthead__cta {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 7px 15px;
  border-radius: 980px;
  background: var(--ink);
  color: #fff;
  white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-out),
              background-color var(--dur-hover) var(--ease-out);
}

.masthead__toggle {
  display: none;
  margin-left: auto;
  width: 40px; height: 40px;
  border: 0; background: none; padding: 0;
  cursor: pointer;
}
.masthead__toggle span {
  display: block; width: 18px; height: 1.5px; margin: 4px auto;
  background: var(--ink); border-radius: 2px;
  transition: transform var(--dur-hover) var(--ease-out),
              opacity var(--dur-hover) var(--ease-out);
}

/* ------------------------------------------------------------- buttons --- */
.btn {
  display: inline-block;
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 980px;
  transition: transform var(--dur-press) var(--ease-out),
              background-color var(--dur-hover) var(--ease-out),
              color var(--dur-hover) var(--ease-out);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { color: var(--accent); padding-inline: 0; }
.btn--ghost::after {
  content: "›";
  display: inline-block;
  margin-left: 5px;
  transition: transform var(--dur-hover) var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn-row { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; margin-top: 30px; }
.center .btn-row, .hero .btn-row { justify-content: center; }

/* Mobile navigation is hidden until the small-screen breakpoint opens it. */
.mobilenav { display: none; }

/* ----------------------------------------------------------------- hero -- */
.hero { padding-top: clamp(44px, 6vw, 76px); text-align: center; }
.hero .lede { margin-inline: auto; max-width: 660px; }
.hero__media {
  margin-top: clamp(32px, 4vw, 52px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- media -- */
.figure { overflow: hidden; background: var(--surface-2); border-radius: 18px; }
.figure img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; }
/* Full-width lead images sit better letterboxed — a 3:2 at full measure
   fills the whole viewport and buries the article. */
.figure--wide img { aspect-ratio: 16 / 9; }

/* Alternating text / image rows */
.split {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip .split__text { order: 2; }
}

/* ---------------------------------------------------------------- cards -- */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  padding: 32px 28px 34px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out);
}
.section--tint .card { background: #fff; border-color: transparent; }
.card h3 { font-size: 21px; letter-spacing: -0.014em; }
.card p { margin: 12px 0 0; color: var(--ink-2); font-size: 16px; }
.card__num {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}

/* Specification-style list, like Apple's tech-spec rows */
.speclist { list-style: none; margin: 0; padding: 0; }
.speclist li {
  display: flex;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--ink-2);
}
.speclist li::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.section--dark .speclist li { border-color: rgba(255, 255, 255, 0.16); color: #a1a1a6; }

/* ---------------------------------------------------------------- brand -- */
/* The wordmark keeps its own aspect ratio — height:auto is what stops the
   squashing you get from width/height attributes that don't match the file. */
.brandmark {
  width: 200px;
  height: auto;
  margin-bottom: 22px;
}
.section--dark .brandmark { filter: brightness(0) invert(1); opacity: 0.95; }

/* ------------------------------------------------------- inner page head -- */
.pagehead {
  padding-block: clamp(52px, 7vw, 96px) clamp(28px, 4vw, 52px);
  text-align: center;
}
.pagehead .lede { margin-inline: auto; max-width: 640px; }
.crumbs { font-size: 14px; color: var(--ink-3); margin: 0 0 16px; }
/* The page title and the first section are one thought — don't leave a
   full band of air between them. */
.pagehead + .section { padding-top: clamp(20px, 2.5vw, 36px); }
.crumbs a { text-decoration: none; }

/* ------------------------------------------------------------- articles -- */
.article { max-width: 680px; margin-inline: auto; }
.article p { margin: 0 0 22px; font-size: 18px; line-height: 1.62; color: #333336; }
.article h2 { font-size: 28px; letter-spacing: -0.018em; margin: 40px 0 14px; }
.article__meta { margin-bottom: 30px; }

.postlist { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.post {
  display: block; text-decoration: none;
  border-radius: 18px; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out);
}
.post img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.post__body { padding: 24px 24px 28px; }
.post__body h3 { font-size: 20px; letter-spacing: -0.014em; }
.post__body p { margin: 10px 0 0; font-size: 16px; color: var(--ink-2); }

/* ----------------------------------------------------------------- form -- */
.form { max-width: 560px; margin-inline: auto; }
.field { margin-bottom: 20px; }
.field label {
  display: block; margin-bottom: 7px;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; font-size: 16px;
  color: var(--ink);
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 143, 123, 0.12);
}
.form button {
  font: inherit; font-size: 17px;
  padding: 13px 28px;
  border: 0; border-radius: 980px;
  background: var(--accent); color: #fff;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out),
              background-color var(--dur-hover) var(--ease-out);
}
.form button:active { transform: scale(0.97); }

/* ------------------------------------------------------------ error page -- */
.errorpage { padding-block: clamp(80px, 14vw, 180px); text-align: center; }
.errorpage .code {
  font-size: clamp(64px, 12vw, 128px);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  color: var(--accent);
}

/* --------------------------------------------------------------- footer -- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 48px 40px;
  font-size: 14px;
  color: var(--ink-3);
}
.footer__cols {
  display: grid;
  gap: 34px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 34px;
}
.footer h4 { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 12px; letter-spacing: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li + li { margin-top: 9px; }
.footer a { text-decoration: none; transition: color var(--dur-hover) var(--ease-out); }
.footer__legal { padding-top: 22px; border-top: 1px solid var(--line); }

/* ----------------------------------------------------------- transitions -- */
/* Hidden state only applies once JS confirms it can run, so a script failure
   leaves the content visible rather than blank. */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity var(--dur-enter) var(--ease-out),
              transform var(--dur-enter) var(--ease-out);
}
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* -------------------------------------------------------------- pointers -- */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { opacity: 1; }
  .masthead__cta:hover { background: #000; }
  .btn--primary:hover { background: #0b7f6e; }
  .btn--ghost:hover::after { transform: translateX(4px); }
  .card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08); }
  .post:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08); }
  .form button:hover { background: #0b7f6e; }
  .footer a:hover { color: var(--ink); }
}

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 767px) {
  .nav, .masthead__cta { display: none; }
  .masthead__toggle { display: block; }
  .masthead.is-open + .mobilenav { display: block; }
  .mobilenav {
    display: none;
    position: sticky; top: 52px; z-index: 49;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 8px 22px 18px;
  }
  .mobilenav a {
    display: block; padding: 11px 0; font-size: 17px;
    text-decoration: none; border-bottom: 1px solid var(--line);
  }
  .mobilenav a:last-child { border-bottom: 0; }
}

/* ------------------------------------------------------- reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal [data-reveal] { transform: none; transition: opacity 240ms ease; }
  .card, .post, .btn, .masthead__cta, .btn--ghost::after {
    transition-property: background-color, color, box-shadow;
  }
  .card:hover, .post:hover, .btn:active,
  .masthead__cta:hover, .btn--ghost:hover::after { transform: none !important; }
}
