/* ============ TypoWise AI — Anthropic-style editorial ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #141413;
  --body-ink: #3d3d3a;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, #f1f3f7 0%, #e9edf4 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1240px, 92%); margin-inline: auto; }

a { color: inherit; }

/* ============ TOP — rounded shell card on cream ============ */
.top {
  position: relative;
  min-height: calc(100svh - 2 * clamp(14px, 2.4vw, 30px));
  margin: clamp(14px, 2.4vw, 30px);
  border-radius: clamp(20px, 2.6vw, 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 76px; /* room for the fixed nav */
  background: linear-gradient(180deg, #f1f3f7 0%, #e9edf4 100%);
}

/* sky frame below the hero text — rounded corners all around */
.sky {
  position: relative;
  width: min(880px, 82%);
  height: clamp(240px, 42svh, 460px);
  margin: 0 auto clamp(14px, 2vw, 22px);
  border-radius: clamp(16px, 2vw, 24px);
  overflow: hidden;
  background: #cfd6e6;
}

/* JS writes a single transform here (pointer + scroll parallax) */
.sky-shift {
  position: absolute;
  inset: -6%;
  will-change: transform;
}

.sky-img {
  width: 100%;
  height: 100%;
  display: block;
  filter: saturate(1.08);
  transform: scale(1.01);
}
/* no-WebGL fallback keeps the painted JPEG */
.sky-img.fallback {
  background: url("hero-bg.jpg") 50% 42% / cover no-repeat;
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 40px;
  /* aligns the wordmark with the card edge: card margin + inner padding */
  padding: calc(clamp(14px, 2.4vw, 30px) + 4px) calc(clamp(14px, 2.4vw, 30px) + 40px) 16px;
  transition: background .3s ease, border-color .3s ease,
              backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
/* glass bar once the user scrolls */
.nav.scrolled {
  background: rgba(241, 243, 247, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(20, 20, 19, .07);
}

.wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}
.wm-ai { font-weight: 800; }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  position: relative;
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease-out);
}
.nav-link:hover::after { transform: scaleX(1); }

.btn-try {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 10px;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.btn-try:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(20, 20, 19, .28);
}

/* ============ HERO — centered, fills the viewport ============ */
.hero {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 0 32px;
}

.hero-h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.9vw, 4.4rem);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.08;
  text-wrap: balance;
  max-width: 1000px;
}

.hero-side {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.45vw, 1.3rem);
  line-height: 1.55;
  color: #55534c;
  max-width: 620px;
  margin-top: 28px;
  text-wrap: pretty;
}

/* one-time entrance for the hero */
.hero-h1, .hero-side { animation: rise .9s var(--ease-out) both; }
.hero-side { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }


/* ============ SECTIONS ============ */
.section { padding: 110px 0; }

.sec-h {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  letter-spacing: -.01em;
  margin-bottom: 48px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.body-serif {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--body-ink);
}
.body-serif strong { color: var(--ink); }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 84px;
}
.pillar { border-top: 1px solid #d8d4ca; padding-top: 20px; }
.pillar h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  margin-bottom: 10px;
}
.pillar p { font-size: 15px; line-height: 1.55; color: var(--body-ink); }

/* scroll reveal — transform/opacity only, compositor-friendly */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity .8s ease var(--d, 0s),
    transform .8s var(--ease-out) var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ============ LATEST RELEASES — release cards ============ */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.rel-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .5);
  border: 1px solid #d8dce8;
  border-radius: 16px;
  padding: 30px 28px 28px;
}
.rel-card h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}
.rel-desc {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--body-ink);
  margin-bottom: 26px;
}
.rel-meta {
  margin-top: auto;
  margin-bottom: 22px;
}
.rel-meta div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #d8dce8;
  font-size: 13.5px;
}
.rel-meta div:first-child { border-top: 1px solid #d8dce8; }
.rel-meta dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #7a7d88;
}
.rel-meta dd { margin: 0; }
.rel-meta a { text-underline-offset: 3px; }
.rel-btn {
  align-self: flex-start;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 9px;
  text-decoration: none;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.rel-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(20, 20, 19, .24);
}

/* ============ NEWS — index table, editorial style ============ */
.news-table { border-top: 1px solid #c9cede; }
.news-row {
  display: grid;
  grid-template-columns: 170px 220px 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid #d8dce8;
}
.news-head {
  padding: 14px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7a7d88;
}
.news-empty {
  padding: 46px 0 52px;
  font-family: var(--serif);
  font-size: 19px;
  color: #7a7d88;
}

/* ============ NEWS PAGE (/news) ============ */
.news-main { padding: 150px 0 130px; }
.news-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}
.news-head-row .sec-h {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  margin: 0;
}

/* search pill — magnifier inset, glass input */
.news-search {
  position: relative;
  display: block;
  width: min(320px, 100%);
}
.news-search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  color: #7a7d88;
  pointer-events: none;
}
.news-search input {
  width: 100%;
  font: 500 15px var(--sans);
  color: var(--ink);
  padding: 12px 16px 12px 42px;
  border: 1px solid #c9cede;
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease,
              background .15s ease;
}
.news-search input::placeholder { color: #9a9daa; }
.news-search input:focus {
  border-color: #8a90a8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(80, 100, 170, .10);
}
/* keep the native clear affordance but drop the odd default styling */
.news-search input::-webkit-search-decoration,
.news-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ============ RESEARCH PAGE (/research) ============ */
.research-main { padding: 150px 0 110px; }
.research-head {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 56px;
}
.research-head .sec-h {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  margin: 0;
}
.research-intro .body-serif { font-size: 20px; }
.research-areas {
  margin-top: 28px;
  font-size: 14px;
  font-weight: 600;
}
.research-areas a {
  font-weight: 500;
  margin-left: 16px;
  text-underline-offset: 3px;
}
.rule { border: 0; border-top: 1px solid #c9cede; margin: 0 0 64px; }
.teams {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 44px;
}
.team h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}
.team p {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--body-ink);
}
.teams + .rule { margin-top: 64px; }

/* ============ LEGAL DOCS ============ */
.legal-main { padding: 150px 0 120px; }
.legal-doc { max-width: 720px; }
.legal-doc .sec-h { margin-bottom: 16px; }
.legal-updated { font-size: 14px; color: #7a7f8e; }
.legal-doc section { margin-top: 44px; }
.legal-doc h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -.005em;
  margin-bottom: 12px;
}
.legal-doc p, .legal-doc li {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--body-ink);
}
.legal-doc p + p { margin-top: 12px; }
.legal-doc ul {
  margin-top: 10px;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}
.legal-doc a { text-decoration: underline; text-underline-offset: 3px; }

/* ============ PLATFORM AUTH (/login, /home) ============ */
.auth-body { background: #fbfaf8; }
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100svh;
}
.auth-left { position: relative; background: #0a0c10; overflow: hidden; }
.auth-left canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 96px);
}
.auth-card { width: min(400px, 100%); }
.auth-h {
  font-family: var(--sans);
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.12;
  margin-bottom: 38px;
}
.auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  border: 1px solid #e3e2db;
  border-radius: 6px;
  background: #ecebe7;
  font: 500 14.5px var(--sans);
  color: var(--ink);
  cursor: pointer;
  transition: background .18s var(--ease-out);
}
.auth-google:hover { background: #e4e3de; }
.auth-google svg { width: 18px; height: 18px; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: #a8a79f;
  font-size: 12.5px;
}
.auth-or::before, .auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e3e2db;
}
.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #e3e2db;
  border-radius: 6px;
  background: #f4f3ef;
  font: 400 14.5px var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-input::placeholder { color: #a8a79f; }
.auth-input:focus { border-color: #141413; box-shadow: 0 0 0 3px rgba(20,20,19,.06); }
.auth-cta {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: #141413;
  color: #fff;
  font: 500 14.5px var(--sans);
  cursor: pointer;
  transition: background .18s var(--ease-out);
}
.auth-cta:hover { background: #2b2b28; }
.auth-cta:disabled { opacity: .55; cursor: default; }
.auth-err {
  min-height: 18px;
  font-size: 12.5px;
  color: #b0492f;
  margin: 8px 0 10px;
}
.auth-legal {
  margin-top: 30px;
  font-size: 12.5px;
  color: #9a998f;
  line-height: 1.6;
}
.auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* code-entry view */
.auth-box {
  border: 1px solid #e3e2db;
  border-radius: 10px;
  background: rgba(255,255,255,.55);
  padding: 28px 26px 30px;
  text-align: center;
}
.auth-box-lead { font-size: 14px; color: #6f6e68; margin-bottom: 14px; }
.auth-mail-pill {
  display: inline-block;
  background: #efeee9;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.auth-resend {
  display: block;
  font-size: 13.5px;
  color: #3b64c8;
  text-decoration: none;
  margin: 0 0 6px;
}
.auth-resend:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-resend.cooling { color: #a5a49b; pointer-events: none; }
.auth-resend.cooling:hover { text-decoration: none; }
.auth-box-rule {
  border: 0;
  border-top: 1px solid #e7e6e0;
  margin: 24px 0 8px;
}
.auth-code {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid #d9d8d0;
  background: transparent;
  padding: 10px 0 12px;
  text-align: center;
  font: 500 24px var(--sans);
  letter-spacing: .45em;
  color: var(--ink);
  outline: none;
  transition: border-color .18s;
}
.auth-code::placeholder { color: #c9c8bf; letter-spacing: .45em; }
.auth-code:focus { border-bottom-color: #141413; }
.auth-code:disabled { opacity: .55; }
.auth-code-wrap { position: relative; }
.auth-spin {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -11px;
  border: 2px solid #dcdad2;
  border-top-color: #1c1b17;
  border-radius: 50%;
  animation: auth-spin .65s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-code.shake { animation: auth-shake .45s cubic-bezier(.36,.07,.19,.97); border-bottom-color: #b0492f; }
@keyframes auth-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
#view-email:not([hidden]),
#view-code:not([hidden]) { animation: auth-view-in .38s cubic-bezier(.22,.8,.36,1) both; }
@keyframes auth-view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-note {
  margin-top: 22px;
  font-size: 13px;
  color: #8f8e86;
  text-align: center;
}
.auth-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* /home — minimal authed shell */
.home-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.home-shell .wordmark { margin-bottom: 40px; }
.home-h {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -.01em;
  margin-bottom: 14px;
}
.home-sub { font-size: 15px; color: var(--body-ink); }
.home-note { margin-top: 26px; font-size: 14px; color: #8f8e86; }
.home-actions { margin-top: 42px; display: flex; gap: 14px; align-items: center; }
.home-back { width: auto; padding: 0 22px; display: inline-flex; align-items: center; text-decoration: none; }
.auth-out {
  height: 46px;
  padding: 0 22px;
  border: 1px solid #d9d8d0;
  border-radius: 6px;
  background: transparent;
  font: 500 14px var(--sans);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s;
}
.auth-out:hover { border-color: #141413; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid #d8dce8;
  background: #e2e6ef;
  padding: 60px 0 50px;
}
.footer-wm { display: inline-block; margin-bottom: 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 40px;
}
.fcol h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 14px;
}
.fcol a {
  display: block;
  font-size: 14.5px;
  text-decoration: none;
  color: var(--body-ink);
  padding: 4px 0;
}
.fcol a:hover { text-decoration: underline; text-underline-offset: 3px; }
.copyright {
  margin-top: 50px;
  font-size: 13px;
  color: #888;
}

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

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .hero-h1, .hero-side { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: 32svh 1fr; }
  .auth-right { justify-content: center; padding-top: 40px; }
  .nav { flex-wrap: wrap; gap: 18px; padding: 16px 20px; }
  .nav-right { margin-left: 0; width: 100%; justify-content: flex-start; gap: 24px; }
  .top { padding-top: 118px; } /* taller wrapped nav */
  .news-main { padding-top: 140px; }
  .research-main { padding-top: 140px; }
  .research-head { grid-template-columns: 1fr; gap: 32px; }
  .teams { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 30px; }
  .pillars { grid-template-columns: 1fr; gap: 28px; margin-top: 60px; }
  .rel-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .news-row { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 560px) {
  .teams { grid-template-columns: 1fr; }
}
