/* ============================================================================
   Cortal production landing — the Thinking Machines Lab idiom.
   Served from apps/landing/public. Design notes: apps/landing/design.

   Every value below was lifted from thinkingmachines.ai's own stylesheets
   (common.css / typography.css / ui.css / fonts.css, captured 2026-07-27)
   or from computed styles probed in Chromium at 1440x1000 @2x.
   `../design/.research/probe-ref.json` is the numeric reference this file is
   diffed against; `../design/.research/DESIGN.md` records provenance per value.

   ONE deliberate substitution: GT America is a licensed Grilli Type face we
   have no right to ship, so the sans role is filled by Switzer (Fontshare,
   free) metric-tuned via size-adjust to land on GT America's rendered
   dimensions. Everything else is the real thing.
   ========================================================================= */

/* --- Fonts -------------------------------------------------------------- */

/* Chakra Petch — the display face. OFL, self-hosted, byte-identical to the
   files thinkingmachines.ai serves. */
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/chakra-petch/chakra-petch-v12-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/chakra-petch/chakra-petch-v12-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./assets/fonts/chakra-petch/chakra-petch-v12-latin-600.woff2') format('woff2');
}

/* Switzer standing in for GT America Standard.
   MEASURED, not guessed (`../design/.research/metrics.mjs`, both faces rendered in
   Chromium against identical strings at 10/15/23.2px):
     advance-width ratio GT:Switzer = 1.0006 mean, 0.9977..1.0034 worst case.
   That is a 0.06% mean error, so size-adjust stays at 100% and the 660px
   measure breaks on the same words as upstream. Vertical metrics do differ
   (GT cap 71 / x 50, Switzer cap 68 / x 53.1 per 100px) — Switzer reads a
   touch larger in lowercase. Correcting that would cost the width match and
   move every line break, so it is accepted and left alone. */
@font-face {
  font-family: 'Sans Sub';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/switzer/Switzer-Regular.woff2') format('woff2');
  size-adjust: 100%;
}
@font-face {
  font-family: 'Sans Sub';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/switzer/Switzer-Italic.woff2') format('woff2');
  size-adjust: 100%;
}
@font-face {
  /* 450 is a real weight on this site (the pill, #main-title). Switzer has no
     450 static, so Medium carries it — closer than Regular at small sizes. */
  font-family: 'Sans Sub';
  font-style: normal;
  font-weight: 450 500;
  font-display: swap;
  src: url('./assets/fonts/switzer/Switzer-Medium.woff2') format('woff2');
  size-adjust: 100%;
}
@font-face {
  font-family: 'Sans Sub';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./assets/fonts/switzer/Switzer-Semibold.woff2') format('woff2');
  size-adjust: 100%;
}
@font-face {
  font-family: 'Sans Sub';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/switzer/Switzer-Bold.woff2') format('woff2');
  size-adjust: 100%;
}

/* --- Tokens (verbatim from thinkingmachines.ai :root) ------------------- */

:root {
  --content-pad: 1.3rem;
  --content-max: calc(660px + 2 * var(--content-pad));

  --bg: white;
  --bg_code: #f3f3f2;

  --fg: #282828;
  --fg1: #3c3836;
  --fg2: #504945;
  --fg3: #6b6866;
  --fg4: #676767;
  --fg5: #969696;

  --red: #ad2111;
  --blue: #0e9ee4;

  --hover-bg: rgba(128, 128, 128, 0.12);

  --font-sans: 'Sans Sub', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Iowan Old Style ships with macOS; TML self-hosts the same face. Same
     stack, same rendering on this machine, no licensing question. */
  --font-serif: 'Iowan Old Style', 'Iowan Old Style BT', Georgia, serif;

  --site-header-height: 54px;
}

/* --- Reset -------------------------------------------------------------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--fg4) var(--bg);
  scroll-padding-top: calc(var(--site-header-height) + 1rem);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: clip;
}

a {
  text-decoration: none;
  transition: color 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
a:link { color: var(--fg4); }
a:hover,
a:visited { color: var(--fg4); opacity: 1; }

::selection { background-color: rgba(0, 0, 0, 0.12); }

hr {
  background-color: var(--fg4);
  margin: 1rem 0;
  border: 0;
  height: 1px;
}

/* --- Shell -------------------------------------------------------------- */

#wrapper {
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  font-family: var(--font-serif);
  min-height: 100vh;
  overflow-wrap: break-word;
  padding: var(--site-header-height) 1rem 0;
}

#header {
  align-items: center;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  transition: transform 0.3s ease;
}

#header .site-header {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 1rem;
  right: 1rem;
  z-index: 1002;
  height: var(--site-header-height);
  padding: 0 1rem;
  background: var(--bg);
}

.navbar-spacer { flex-shrink: 0; }

/* Homepage scroll-in wordmark: mobile only, exactly as upstream. */
#header .navbar-logo-home { display: none; }

#header .navbar-logo a {
  font-family: 'Chakra Petch';
  font-weight: 500;
  font-size: 17px;
  line-height: 25px;
  letter-spacing: 1.7px;
  color: var(--fg4);
  text-decoration: none;
  transition: opacity 0.3s ease-in-out;
}
#header .navbar-logo a:hover { opacity: 0.8; }

.nav-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.top-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  font-family: var(--font-sans);
}

.top-nav a {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--fg1);
  text-decoration: none;
  transition: opacity 0.3s ease-in-out;
  display: flex;
  align-items: center;
  height: 100%;
  opacity: 1;
}

.top-nav a:hover {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--fg) 20%, transparent);
  text-underline-offset: 2px;
}

/* --- Hero wordmark ------------------------------------------------------ */

.logo-container {
  max-width: 56rem;
  margin-inline: auto;
  padding-block: 1rem 1.35rem;
  text-align: center;
  animation: fadeIn 0.6s ease-in-out;
}

.logo {
  position: relative;
  overflow: hidden;
  background: white;
  border: solid 1px white;
  backface-visibility: hidden;
  animation: float 7s ease-in-out infinite;
  display: inline-block;
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(3em, 8vw, 3.4em);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-wrap: stable;
  color: inherit !important;
  text-decoration: none !important;
}

/* The reason the wordmark reads warm grey rather than charcoal: a rotating
   linear gradient screened over the glyphs. Without this the logo comes out
   flat #282828 and the whole fold sits too heavy. Caught by pixel-diffing the
   wordmark against the reference — the letterforms matched exactly and only
   the colour was wrong. */
.logo::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  aspect-ratio: 1;
  background: linear-gradient(90deg, #565151, #d2caca);
  mix-blend-mode: screen;
  animation: gradRotate 8s linear infinite;
  pointer-events: none;
  max-width: 100vw;
  overflow: clip;
  transform-origin: center;
  transform: translate(-50%, -50%);
}

@keyframes gradRotate {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes float {
  0%   { transform: translateY(5px); }
  50%  { transform: translateY(-5px); }
  100% { transform: translateY(5px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.home-announcement {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  position: relative;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}

.home-announcement .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  height: 26px;
  font-family: var(--font-sans);
  font-weight: 450;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg1);
  background: rgba(0, 0, 0, 0.04);
  border-radius: 100px;
  transition: background-color 0.2s ease;
}

.home-announcement:hover .pill { background: rgba(0, 0, 0, 0.06); }

.home-announcement .announcement-text {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--fg);
  text-decoration: none;
  max-width: 660px;
  text-wrap: balance;
}

.home-announcement:hover .announcement-text {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--fg) 20%, transparent);
  text-underline-offset: 2px;
}

/* --- Main column -------------------------------------------------------- */

main {
  margin: 0;
  flex: 1;
  padding-inline: 1rem;
}

#main {
  align-self: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
  margin: auto;
  max-width: 680px;
  padding: 1rem;
  animation: fadeIn 0.6s ease-in-out;
}

/* The measure is load-bearing: the outer column carries the horizontal padding
   so the text column itself stays exactly 660px. Getting this wrong changes
   every line break on the page. */
#main.index.content {
  max-width: var(--content-max);
}

#main.content > article.content {
  max-width: 660px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.content { padding-top: 0.5rem; }
.content :last-child { margin-bottom: 0; }

.content p,
.content h1,
.content h2,
.content h3,
.content ul,
.content ol {
  margin-top: 0;
  margin-bottom: 1.333rem;
}

.content a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--fg4) 30%, transparent);
  transition: color 0.3s ease-in-out, text-decoration-color 0.3s ease-in-out;
}

.content a:hover {
  color: var(--fg2);
  text-decoration-color: color-mix(in srgb, var(--fg2) 30%, transparent);
}

/* Index-page overrides — the homepage runs a looser rhythm and left-aligns
   its section heads in the sans face. */
#main.index.content p { margin-bottom: 1.8rem; }

#main.index.content h1,
#main.index.content h2,
#main.index.content h3 {
  text-align: left;
  /* Site-wide heading voice is the serif (landing + product pages match). */
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

#main.index.content h2 {
  font-size: 1.45rem;
  margin-top: 2.8rem;
  margin-bottom: 1rem;
}

#main.index.content h3 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}

.content ul {
  list-style: square;
  margin-left: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1.2rem;
}
.content ul > li { margin-bottom: 0.2rem; }

.content blockquote:not(.epigraph) {
  border-left: 2px solid color-mix(in srgb, var(--fg4) 35%, var(--bg) 65%);
  color: var(--fg2);
  margin: 1.6rem 0 1.6rem 1rem;
  padding: 0.1rem 0 0.1rem 1.25rem;
}

.content code {
  color: var(--red);
  font-family: SFMono-Regular, 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  padding: 0 0.2rem;
  font-size: 0.9em;
}

/* --- Buttons (ui.css, verbatim) ----------------------------------------- */

@keyframes btn-spring {
  0%   { transform: scale(0.96); }
  40%  { transform: scale(1.02); }
  70%  { transform: scale(0.99); }
  100% { transform: scale(1); }
}

.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 14px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 160ms ease,
    transform 120ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  transform: scale(1);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  border-radius: inherit;
}

.btn:active { transform: scale(0.96) !important; }

.btn.btn-spring {
  animation: btn-spring 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  transition: border-color 180ms ease, box-shadow 160ms ease !important;
}

.btn.primary {
  background: linear-gradient(180deg, #f3f2f2 0%, #e6e6e6 87.5%) !important;
  border-radius: 100px;
  border: none !important;
  color: black !important;
}
.btn.primary:visited { color: black !important; opacity: 1 !important; }
.btn.primary:hover::before { opacity: 0.04; }
.btn.primary:active::before { opacity: 0.08; }

.btn.secondary {
  background: linear-gradient(180deg, #fff 5.17%, #f6f6f6 22.41%, #f4f5f7 82.31%, #f6f7f9 94.83%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--fg) !important;
}
.btn.secondary:hover { border-color: rgba(0, 0, 0, 0.14); }
.btn.secondary:hover::before { opacity: 0.02; }
.btn.secondary:active::before { opacity: 0.05; }

.btn.big, .btn.lg {
  font-size: 15px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 100px;
}

/* --- Footer ------------------------------------------------------------- */

#footer {
  --footer-inset: var(--content-pad);
  --footer-column-gap: clamp(1rem, 2.5vw, 2rem);
  --footer-max-width: 952px;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--fg4);
  align-items: flex-start;
  display: flex;
  font-size: 15px;
  letter-spacing: -0.01em;
  flex-direction: column;
  margin-top: 9rem;
  padding-bottom: 1.75rem;
  background-color: var(--bg);
  width: 100%;
}

/* Hairline above the columns, inset to the same 952px box so its ends line up
   with the column grid and the copyright below it. */
#footer::before {
  content: "";
  display: block;
  height: 1px;
  width: calc(100% - 2 * var(--footer-inset));
  max-width: var(--footer-max-width);
  margin: 0 auto 2rem;
  background-color: color-mix(in srgb, var(--fg4) 10%, transparent);
}

/* The footer is sans throughout, including anything that would otherwise
   inherit the page serif. */
#footer * { font-family: inherit !important; }

#footer > .footer-columns {
  width: calc(100% - 2 * var(--footer-inset));
  max-width: var(--footer-max-width);
  margin: 0 auto;
  position: relative;
  text-align: left;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: var(--footer-column-gap);
  width: 100%;
}

.footer-column {
  align-self: flex-start;
  min-width: 0;
  text-align: left;
}

.footer-column h4 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  text-transform: none;
  color: var(--fg4);
  margin: 0 0 0.5rem;
}

.footer-column .footer-subheading { margin: 2rem 0 0.5rem; }

.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column li { margin-bottom: 0.5rem; font-size: 15px; }

.footer-column a,
.footer-column span {
  color: var(--fg1);
  text-decoration: none;
  transition: color 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.footer-column a:hover {
  color: var(--fg1);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--fg) 20%, transparent);
  text-underline-offset: 2px;
}

.footer-copyright {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--fg4);
  text-align: left;
  width: calc(100% - 2 * var(--footer-inset));
  max-width: var(--footer-max-width);
  margin: 3rem auto 0;
}

.footer-copyright span { display: block; }

/* --- Mobile ------------------------------------------------------------- */

.hamburger {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  margin-left: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.hamburger span {
  position: absolute;
  left: 9px;
  right: 9px;
  height: 2px;
  background: var(--fg3);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease, bottom 0.25s ease;
}
.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 19px; }
.hamburger span:nth-child(3) { bottom: 12px; }

.hamburger.is-active span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { bottom: auto; top: 19px; transform: rotate(-45deg); }

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
}
.mobile-menu-nav a {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--fg) !important;
  text-decoration: none;
}

body.menu-open { overflow: hidden; }

@media screen and (max-width: 768px) {
  :root { --site-header-height: 50px; }

  #wrapper { padding-left: 0.33rem; padding-right: 0.33rem; }

  #header .site-header {
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    z-index: 1002;
  }

  #header .navbar-logo-home {
    display: flex;
    position: absolute;
    left: 1rem;
    top: 0;
    height: 100%;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: none;
  }
  #header .navbar-logo-home.is-visible { opacity: 1; pointer-events: auto; }
  #header .navbar-logo-home.animate { transition: opacity 180ms ease-in-out; }

  #header .navbar-logo a { font-size: 17px; line-height: 23px; }

  .top-nav { display: none; }
  .hamburger { display: block; }

  #main { width: 100%; }

  /* Section heads stay left on mobile too. */
  #main.index.content h2 { text-align: left; }
}

/* Upstream collapses the footer grid at 800px, not at the 768px nav breakpoint. */
@media (max-width: 800px) {
  #footer { align-items: flex-start; }
  #footer::before { margin-bottom: 2rem; }
  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--footer-column-gap);
    row-gap: 2rem;
    width: 100%;
  }
  .footer-copyright { display: block; }
  .footer-column ul { padding-left: 0; }
}

@media (max-width: 600px) {
  .home-announcement {
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: calc(100% - 2rem);
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
