/*
Theme Name: Teleodynamic AI
Theme URI: https://teleodynamic.com/
Author: Teleodynamic
Description: A block theme for Teleodynamic AI, constraint-maintaining learning, and glyph interpretation research.
Requires at least: 6.8
Tested up to: 6.9
Requires PHP: 8.1
Version: 0.2.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: teleodynamic-ai
*/

:root {
  --td-ink: #f7fbf8;
  --td-muted: #a7b8b7;
  --td-bg: #071113;
  --td-bg-soft: #0d1a1c;
  --td-panel: rgba(12, 25, 27, 0.88);
  --td-line: rgba(178, 213, 204, 0.2);
  --td-teal: #4ee0c2;
  --td-amber: #f2b36d;
  --td-red: #e06b5f;
  --td-blue: #76a7d8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 82% 12%, rgba(78, 224, 194, 0.18), transparent 32rem),
    linear-gradient(140deg, #071113 0%, #0d1719 44%, #111816 100%);
  color: var(--td-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--td-teal);
  text-decoration-color: rgba(78, 224, 194, 0.45);
  text-underline-offset: 0.22em;
}

a:hover,
a:focus {
  color: #8af4df;
}

.wp-site-blocks {
  min-height: 100vh;
}

.td-page {
  overflow: hidden;
}

.td-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.td-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--td-line);
  background: rgba(7, 17, 19, 0.88);
  backdrop-filter: blur(18px);
}

.td-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.td-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--td-ink);
  font-weight: 760;
  text-decoration: none;
}

.td-brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(78, 224, 194, 0.54);
  border-radius: 8px;
  color: var(--td-teal);
  font-family: "Times New Roman", serif;
  font-size: 25px;
}

.td-brand__name {
  display: block;
  line-height: 1.05;
}

.td-brand__note {
  display: block;
  color: var(--td-muted);
  font-size: 0.74rem;
  font-weight: 560;
  margin-top: 3px;
}

.td-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.td-nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--td-muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.td-nav a:hover,
.td-nav a:focus {
  border-color: rgba(78, 224, 194, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: var(--td-ink);
}

.td-hero {
  position: relative;
  min-height: min(780px, calc(100vh - 72px));
  display: grid;
  align-items: center;
  padding: clamp(48px, 7vw, 84px) 0;
}

.td-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
}

.td-kicker {
  width: fit-content;
  margin: 0 0 18px;
  padding: 7px 10px;
  border: 1px solid rgba(242, 179, 109, 0.4);
  border-radius: 999px;
  color: #ffd19e;
  background: rgba(242, 179, 109, 0.08);
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
}

.td-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3.2rem, 6.6vw, 7.1rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.td-lede {
  max-width: 620px;
  margin: 24px 0 0;
  color: #d9e5e1;
  font-size: clamp(1.08rem, 1.6vw, 1.34rem);
  line-height: 1.58;
}

.td-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.td-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 760;
  text-decoration: none;
}

.td-button--primary {
  background: var(--td-teal);
  color: #041413;
}

.td-button--ghost {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--td-ink);
  background: rgba(255, 255, 255, 0.05);
}

.td-button:hover,
.td-button:focus {
  transform: translateY(-1px);
}

.td-hero-image {
  position: relative;
  margin: 0;
}

.td-hero-image img {
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.td-status-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.td-status {
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.td-status strong {
  display: block;
  color: var(--td-ink);
  font-size: 0.88rem;
}

.td-status span {
  color: var(--td-muted);
  font-size: 0.76rem;
}

.td-section {
  padding: clamp(50px, 7vw, 86px) 0;
  border-top: 1px solid var(--td-line);
}

.td-page-hero {
  padding: clamp(56px, 8vw, 108px) 0 clamp(42px, 6vw, 76px);
}

.td-page-hero h1 {
  max-width: 940px;
  margin: 0;
  font-size: clamp(3rem, 5.8vw, 6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.td-page-hero--with-art {
  padding-bottom: clamp(52px, 7vw, 92px);
}

.td-section h2 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.td-section__intro {
  max-width: 780px;
  margin: 18px 0 0;
  color: var(--td-muted);
  font-size: 1.06rem;
  line-height: 1.68;
}

.td-copy {
  max-width: 760px;
  margin: 16px 0 0;
  color: #d9e5e1;
  line-height: 1.68;
}

.td-two {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: clamp(24px, 5vw, 62px);
  align-items: start;
}

.td-band {
  background: rgba(255, 255, 255, 0.032);
}

.td-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

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

.td-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.td-route-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.td-card {
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 20px;
  background: var(--td-panel);
}

.td-card h3 {
  margin: 0 0 10px;
  font-size: 1.04rem;
}

.td-card p {
  margin: 0;
  color: var(--td-muted);
  line-height: 1.58;
}

.td-card--accent {
  border-color: rgba(242, 179, 109, 0.38);
  background: linear-gradient(180deg, rgba(242, 179, 109, 0.13), rgba(12, 25, 27, 0.9));
}

.td-callout,
.td-formula-card,
.td-diagram-card,
.td-code-card {
  border: 1px solid rgba(118, 167, 216, 0.26);
  border-radius: 8px;
  padding: 20px;
  background: rgba(12, 25, 27, 0.88);
}

.td-callout h3 {
  margin: 0 0 10px;
  color: #fff0d6;
}

.td-callout p {
  margin: 0;
  color: var(--td-muted);
}

.td-formula-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.td-formula-card span {
  color: var(--td-amber);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.td-formula-card strong {
  color: #f7fbf8;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(1rem, 1.7vw, 1.28rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.td-formula-card p {
  margin: 0;
  color: var(--td-muted);
}

.td-callout--amber {
  border-color: rgba(242, 179, 109, 0.36);
  background: rgba(242, 179, 109, 0.08);
}

.td-contact-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(78, 224, 194, 0.32);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(78, 224, 194, 0.11), rgba(12, 25, 27, 0.92)),
    var(--td-panel);
}

.td-contact-card span {
  color: var(--td-amber);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.td-contact-card a {
  display: block;
  color: var(--td-ink);
  font-size: 1.08rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.td-contact-card p {
  margin: 4px 0 0;
  color: var(--td-muted);
}

.td-code-card {
  display: block;
  margin: 0;
  overflow-x: auto;
  color: #dffbf3;
  font-size: 0.9rem;
  line-height: 1.58;
}

.td-code-card code {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  white-space: pre;
}

.td-loop-diagram {
  position: relative;
  min-height: 360px;
  overflow: hidden;
}

.td-loop {
  position: absolute;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  border: 1px solid rgba(78, 224, 194, 0.4);
  border-radius: 50%;
  color: var(--td-ink);
  font-weight: 850;
  text-align: center;
}

.td-loop small {
  color: var(--td-muted);
  font-weight: 650;
}

.td-loop--fast {
  left: 6%;
  top: 14%;
}

.td-loop--slow {
  right: 6%;
  top: 14%;
  border-color: rgba(242, 179, 109, 0.46);
}

.td-loop--core {
  left: 50%;
  top: 48%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -10%);
  border-color: rgba(118, 167, 216, 0.44);
  background: rgba(7, 17, 19, 0.8);
}

.td-pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 28px;
}

.td-pipeline span {
  display: grid;
  min-height: 74px;
  align-items: center;
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 10px;
  color: #e8fff8;
  background: rgba(7, 17, 19, 0.66);
  font-size: 0.84rem;
  font-weight: 760;
}

.td-pipeline--vertical {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.td-pipeline--vertical span {
  min-height: 48px;
}

.td-layer-list,
.td-boundary-stack,
.td-timeline,
.td-archive-grid {
  display: grid;
  gap: 12px;
}

.td-layer-list article,
.td-boundary-stack div,
.td-timeline article,
.td-archive-grid article {
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.td-layer-list article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.td-layer-list--wide article {
  grid-template-columns: 60px minmax(0, 1fr);
}

.td-layer-list span,
.td-timeline span,
.td-archive-grid span {
  color: var(--td-amber);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.td-layer-list h3,
.td-timeline h3,
.td-archive-grid strong {
  margin: 0 0 6px;
  color: var(--td-ink);
  font-size: 1rem;
}

.td-layer-list h3 {
  grid-column: 2;
}

.td-layer-list p,
.td-boundary-stack span,
.td-timeline p,
.td-archive-grid p {
  margin: 0;
  color: var(--td-muted);
  line-height: 1.52;
}

.td-layer-list p {
  grid-column: 2;
}

.td-boundary-stack strong {
  display: block;
  margin-bottom: 5px;
}

.td-table-wrap {
  margin-top: 28px;
  overflow-x: auto;
}

.td-table-wrap table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border: 1px solid var(--td-line);
  border-radius: 8px;
  overflow: hidden;
}

.td-table-wrap th,
.td-table-wrap td {
  border-bottom: 1px solid var(--td-line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

.td-table-wrap th {
  color: #fff0d6;
  background: rgba(242, 179, 109, 0.1);
}

.td-table-wrap td {
  color: var(--td-muted);
}

.td-timeline {
  margin-top: 30px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.td-timeline--six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.td-check-list,
.td-risk-list {
  display: grid;
  gap: 12px;
  max-width: 940px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.td-check-list li,
.td-risk-list li {
  border-left: 3px solid var(--td-teal);
  border-radius: 8px;
  padding: 14px 16px;
  color: #d9e5e1;
  background: rgba(255, 255, 255, 0.045);
}

.td-risk-list li {
  border-left-color: var(--td-red);
}

.td-archive-grid {
  margin-top: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.td-archive-grid strong {
  display: block;
}

.td-flow {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  margin-top: 34px;
}

.td-flow__rail {
  display: grid;
  gap: 10px;
}

.td-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.td-step__num {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(78, 224, 194, 0.13);
  color: var(--td-teal);
  font-weight: 800;
}

.td-step h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.td-step p {
  margin: 0;
  color: var(--td-muted);
  line-height: 1.52;
}

.td-instrument {
  position: relative;
  min-height: 460px;
  border: 1px solid rgba(118, 167, 216, 0.26);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(7, 17, 19, 0.72);
  background-size: 38px 38px;
  overflow: hidden;
}

.td-orbit {
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(78, 224, 194, 0.32);
  border-radius: 50%;
}

.td-orbit--two {
  inset: 23% 10%;
  border-color: rgba(242, 179, 109, 0.36);
  transform: rotate(-18deg);
}

.td-orbit--three {
  inset: 10% 25%;
  border-color: rgba(224, 107, 95, 0.28);
  transform: rotate(33deg);
}

.td-glyphs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 460px;
  margin-inline: auto;
}

.td-glyph {
  display: grid;
  min-height: 76px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--td-ink);
  background: rgba(4, 20, 19, 0.78);
  font-size: 1.8rem;
}

.td-glyph[data-role="constraint"] {
  color: var(--td-teal);
}

.td-glyph[data-role="resource"] {
  color: var(--td-amber);
}

.td-glyph[data-role="risk"] {
  color: var(--td-red);
}

.td-instrument__caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 3;
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 16px;
  color: #d9e5e1;
  background: rgba(5, 13, 14, 0.88);
}

.td-proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.td-proof div {
  border-top: 3px solid var(--td-teal);
  padding: 14px 0 0;
}

.td-proof strong {
  display: block;
  color: var(--td-ink);
}

.td-proof span {
  display: block;
  margin-top: 6px;
  color: var(--td-muted);
  line-height: 1.45;
}

.td-note {
  margin-top: 28px;
  border-left: 3px solid var(--td-amber);
  padding: 16px 18px;
  color: #e7d5bd;
  background: rgba(242, 179, 109, 0.08);
}
.td-memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.td-link-card {
  display: flex;
  min-height: 238px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 20px;
  color: var(--td-ink);
  background: linear-gradient(180deg, rgba(118, 167, 216, 0.14), rgba(12, 25, 27, 0.9));
  text-decoration: none;
}

.td-link-card--feature {
  border-color: rgba(78, 224, 194, 0.32);
  background:
    linear-gradient(180deg, rgba(78, 224, 194, 0.12), rgba(12, 25, 27, 0.92)),
    rgba(12, 25, 27, 0.88);
}

.td-link-card span {
  color: var(--td-amber);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.td-link-card strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.2;
}

.td-link-card em {
  color: var(--td-muted);
  font-style: normal;
  line-height: 1.55;
}

.td-link-card:hover,
.td-link-card:focus {
  border-color: rgba(78, 224, 194, 0.48);
  color: var(--td-ink);
  transform: translateY(-1px);
}

.td-footer {
  border-top: 1px solid var(--td-line);
  padding: 32px 0;
  color: var(--td-muted);
  background: rgba(3, 9, 10, 0.7);
}

.td-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.td-footer__inner p {
  margin: 0 0 8px;
}

.td-site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.td-site-links a {
  border: 1px solid var(--td-line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--td-muted);
  font-size: 0.86rem;
  font-weight: 680;
  text-decoration: none;
}

.td-site-links a:hover,
.td-site-links a:focus {
  border-color: rgba(78, 224, 194, 0.38);
  color: var(--td-ink);
}

@media (max-width: 940px) {
  .td-hero {
    min-height: auto;
  }

  .td-hero__grid,
  .td-flow,
  .td-two {
    grid-template-columns: 1fr;
  }

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

  .td-route-grid {
    grid-template-columns: 1fr;
  }

  .td-proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .td-memory-grid {
    grid-template-columns: 1fr;
  }

  .td-site-links {
    justify-content: flex-start;
  }

  .td-grid--four,
  .td-timeline,
  .td-archive-grid,
  .td-pipeline {
    grid-template-columns: 1fr;
  }

  .td-timeline--six {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .td-shell {
    width: min(100% - 28px, 1180px);
  }

  .td-header__inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .td-nav {
    justify-content: flex-start;
    gap: 8px;
  }

  .td-nav a {
    font-size: 0.84rem;
    padding: 6px 8px;
  }

  .td-hero h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
  }

  .td-grid,
  .td-proof,
  .td-status-rail {
    grid-template-columns: 1fr;
  }

  .td-glyphs {
    grid-template-columns: repeat(2, 1fr);
  }

  .td-instrument {
    min-height: 560px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .td-button,
  .td-link-card,
  .td-glyph {
    transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
  }

  .td-glyph:hover {
    transform: translateY(-2px);
    border-color: rgba(78, 224, 194, 0.46);
  }
}
