/* Torusframe, the company site.
 *
 * The one loud page in the family. It opens on a saturated violet field with
 * the name drawn literally, a torus inside a frame, and then alternates
 * between paper and ink so the page has a rhythm instead of one long surface.
 * The products appear in their own palettes: this page is the only place all
 * three worlds are seen side by side.
 */

/* Header: part of the field, and it stays the field while the page scrolls
   underneath, so the brand colour never leaves the screen. */
.site-header {
  background: var(--tf-field);
  color: var(--tf-on-field);
}

.brand-word {
  font-family: var(--font-unbounded);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header .nav { font-size: var(--text-sm); }
.site-header .nav a { color: var(--tf-on-field-muted); transition: color var(--transition); }
.site-header .nav a:hover { color: var(--tf-on-field); }

.site-header :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible,
.local :focus-visible { outline-color: var(--tf-signal); }

.label { color: var(--text-muted); }

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

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 78% 42%, #4b33ff 0%, transparent 60%),
    linear-gradient(180deg, var(--tf-field) 0%, var(--tf-field) 55%, var(--tf-field-deep) 100%);
  color: var(--tf-on-field);
}

/* Bleeds off the right edge on purpose: the object is bigger than the page. */
.torus {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -14%;
  width: min(1040px, 92vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: clamp(72px, 11vw, 150px) clamp(72px, 9vw, 128px);
}

.hero .hero-kicker { color: var(--tf-signal); }

.hero-title {
  max-width: 13ch;
  font-size: clamp(2.5rem, 6.6vw, 5.75rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.hero-light,
.hero-heavy { display: block; }

.hero-light { font-weight: 250; }

.hero-heavy {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--tf-signal);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.14em;
  text-decoration-skip-ink: none;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: flex-end;
  justify-content: space-between;
  margin-top: var(--space-4);
}

.hero-lead {
  max-width: 44ch;
  color: #d8d3ff;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.button-on-field {
  background: var(--tf-on-field);
  color: var(--tf-field-deep);
}

.button-on-field:hover { background: var(--tf-signal); color: var(--tf-ink); }

.button-ghost-field {
  border-color: rgb(244 242 255 / 0.45);
  color: var(--tf-on-field);
}

.button-ghost-field:hover { border-color: var(--tf-on-field); background: rgb(244 242 255 / 0.08); }

/* Section heads --------------------------------------------------------------- */

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.section-head h2 {
  max-width: 18ch;
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* Products ------------------------------------------------------------------
   Two cards, two worlds. Each borrows its product site's ground, display
   face, and accent, so the family resemblance comes from structure while the
   surfaces are allowed to disagree. */

.product-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
  margin-top: var(--space-8);
}

@media (min-width: 880px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: clamp(24px, 3.6vw, 44px);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}

.product:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -30px rgb(21 18 46 / 0.55);
}

.product-top {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}

.product-kind {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-name {
  margin-top: var(--space-5);
  letter-spacing: -0.03em;
}

.product-copy {
  max-width: 44ch;
  font-size: var(--text-base);
}

.product-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--space-5);
  border-top: 1px solid;
}

.product-status {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.product-link {
  font-weight: 600;
  text-decoration: none;
}

/* The whole card is the link. */
.product-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.product-link .arrow { display: inline-block; transition: transform var(--transition); }
.product:hover .product-link .arrow { transform: translateX(4px); }

/* Trace: graphite, a dot grid, a wide heavy monospace. */
.product-trace {
  background:
    radial-gradient(circle, var(--trace-line) 1px, transparent 1.2px) 0 0 / 18px 18px,
    var(--trace-ground);
  color: var(--trace-text);
}

.product-trace .product-kind,
.product-trace .product-status { color: var(--trace-text-subtle); }
.product-trace .badge { border-color: var(--trace-line-strong); color: var(--trace-text-muted); }
.product-trace .product-copy { color: var(--trace-text-muted); }
.product-trace .product-foot { border-color: var(--trace-line); }
.product-trace .product-link { color: var(--trace-aqua); }
.product-trace :focus-visible { outline-color: var(--trace-aqua); }

.product-trace .product-name {
  font-family: var(--font-mono);
  font-size: clamp(3.25rem, 7vw, 5.5rem);
  font-weight: 800;
  font-stretch: 112.5%;
  line-height: 0.9;
}

.product-trace .product-name::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.82em;
  margin-left: 0.08em;
  background: var(--trace-aqua);
  vertical-align: -0.04em;
  animation: caret 1.1s steps(1) infinite;
}

@keyframes caret { 50% { opacity: 0; } }

.product-keys {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  color: var(--trace-text-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.product-trace kbd {
  min-width: 3.4rem;
  padding: 8px 12px;
  border-color: var(--trace-line-strong);
  border-bottom-width: 4px;
  border-radius: 8px;
  background: var(--trace-panel-2);
  color: var(--trace-text);
  font-size: 0.75rem;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition), color var(--transition);
}

.product-trace .kbd-wide { min-width: 7rem; }

.product-trace:hover kbd {
  transform: translateY(2px);
  border-color: var(--trace-aqua);
  border-bottom-width: 2px;
  color: var(--trace-aqua);
}

/* Orbit: a technical sheet on graph paper, condensed capitals, cobalt. */
/* The grid is a texture, not a table: the top layer fades it out so the copy
   sits on plain paper. */
.product-orbit {
  border: 1px solid var(--orbit-rule);
  background:
    linear-gradient(160deg, rgb(248 249 251 / 0.4), rgb(248 249 251 / 0.94) 55%),
    linear-gradient(var(--orbit-rule) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--orbit-rule) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--orbit-sheet);
  color: var(--orbit-ink);
}

.product-orbit .product-kind,
.product-orbit .product-status { color: var(--orbit-ink-subtle); }
.product-orbit .badge { border-color: var(--orbit-experimental); color: var(--orbit-experimental); }
.product-orbit .product-copy { color: var(--orbit-ink-muted); }
.product-orbit .product-foot { border-color: var(--orbit-rule); }
.product-orbit .product-link { color: var(--orbit-cobalt); }
.product-orbit :focus-visible { outline-color: var(--orbit-cobalt); }

.product-orbit .product-name {
  font-family: var(--font-archivo);
  font-size: clamp(3.75rem, 9vw, 7rem);
  font-weight: 800;
  font-stretch: 62%;
  line-height: 0.82;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.product-orbit-art {
  width: 100%;
  max-width: 300px;
  height: auto;
  color: var(--orbit-ink);
}

/* Local-first ------------------------------------------------------------------
   The ink band. The page's argument, stated once, each line with its proof. */

.local {
  background: var(--tf-ink);
  color: var(--tf-on-field);
}

.local .label { color: var(--tf-signal); }

.tenets {
  display: grid;
  gap: var(--space-7) var(--space-6);
  grid-template-columns: minmax(0, 1fr);
  margin-top: var(--space-8);
}

@media (min-width: 880px) {
  .tenets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tenet {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 3px solid var(--tf-signal);
}

.tenet-title {
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.tenet-proof {
  max-width: 36ch;
  color: #b9b4db;
}

/* About ------------------------------------------------------------------------ */

.about-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 880px) {
  .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}

/* Footer: back to the field, and the name at the size of the page. */

.site-footer {
  position: relative;
  overflow: hidden;
  padding-top: var(--space-6);
  background: var(--tf-field);
  color: var(--tf-on-field-muted);
  font-size: var(--text-sm);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
}

.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.site-footer a { color: var(--tf-on-field); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.footer-word {
  margin: var(--space-7) 0 -0.19em;
  color: rgb(244 242 255 / 0.1);
  font-family: var(--font-unbounded);
  font-size: 12.6vw;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

/* Phones: the torus moves behind the headline instead of beside it. */
@media (max-width: 720px) {
  .torus {
    top: 0;
    right: -40%;
    width: 130vw;
    transform: none;
    opacity: 0.65;
  }

  .hero-title { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .product-trace .product-name::after { animation: none; }
  .product,
  .product:hover { transform: none; }
}
