/*
Theme Name: Thydom Foundation
Theme URI: https://thydom.com
Author: Thydom
Description: Public launch theme for Thydom, a literary technology platform and future reading WebApp around Tolmarher's work.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: thydom
*/

:root {
  --thy-ink: #161615;
  --thy-ink-soft: #3d3a35;
  --thy-paper: #f7f4ee;
  --thy-paper-deep: #e8dfd2;
  --thy-line: #d6ccbf;
  --thy-white: #fffdf8;
  --thy-accent: #cc5f34;
  --thy-accent-strong: #a64526;
  --thy-gold: #c8a24a;
  --thy-blue: #194b64;
  --thy-green: #2f5b4d;
  --thy-shadow: 0 24px 70px rgba(22, 22, 21, .13);
  --thy-radius: 8px;
  --thy-max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--thy-paper);
  color: var(--thy-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
main { flex: 1 0 auto; }

a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
img { display: block; max-width: 100%; height: auto; }

.thy-shell { width: min(var(--thy-max), calc(100% - 40px)); margin: 0 auto; }
.thy-skip { position: absolute; left: -999px; top: 12px; z-index: 10; background: var(--thy-ink); color: var(--thy-white); padding: 10px 14px; }
.thy-skip:focus { left: 12px; }

.thy-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 244, 238, .92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(22, 22, 21, .12);
}
.thy-header__inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.thy-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.thy-brand__mark {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--thy-ink);
  color: var(--thy-white);
  font-size: 16px;
  font-weight: 920;
  box-shadow: 0 10px 24px rgba(22,22,21,.14);
}
.thy-brand__text {
  display: grid;
  gap: 3px;
}
.thy-brand strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
}
.thy-brand small {
  color: var(--thy-ink-soft);
  font-size: 13px;
  font-weight: 760;
}
.thy-menu-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}
.thy-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  font-weight: 760;
}
.thy-nav li { margin: 0; padding: 0; }
.thy-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration: none;
}
.thy-nav a:hover { background: rgba(22,22,21,.06); }
.thy-nav a:hover { color: var(--thy-accent-strong); }
.thy-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--thy-ink);
  border-radius: var(--thy-radius);
}
.thy-nav__cta--panel { text-decoration: none; }
.thy-lang-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--thy-line);
}
.thy-lang-select span {
  color: var(--thy-ink-soft);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.thy-lang-select select {
  min-height: 38px;
  max-width: 140px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--thy-line);
  border-radius: 8px;
  background: var(--thy-white);
  color: var(--thy-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}
.thy-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 46px;
  height: 42px;
  border: 1px solid var(--thy-line);
  border-radius: 8px;
  background: var(--thy-white);
  color: var(--thy-ink);
}
.thy-menu-toggle span {
  position: absolute;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}
.thy-menu-toggle span:nth-child(1) { transform: translateY(-7px); }
.thy-menu-toggle span:nth-child(3) { transform: translateY(7px); }
.thy-menu-toggle em {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
body.is-menu-open .thy-menu-toggle span:nth-child(1) { transform: rotate(45deg); }
body.is-menu-open .thy-menu-toggle span:nth-child(2) { opacity: 0; }
body.is-menu-open .thy-menu-toggle span:nth-child(3) { transform: rotate(-45deg); }

.thy-hero {
  padding: clamp(48px, 7vw, 94px) 0 36px;
  border-bottom: 1px solid var(--thy-line);
}
.thy-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  gap: clamp(28px, 5vw, 58px);
  align-items: center;
}
.thy-kicker {
  margin: 0 0 18px;
  color: var(--thy-accent-strong);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.thy-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(42px, 6.7vw, 82px);
  line-height: .98;
  font-weight: 880;
  letter-spacing: 0;
}
.thy-lede {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--thy-ink-soft);
  font-size: clamp(18px, 2vw, 22px);
}
.thy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.thy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--thy-ink);
  border-radius: var(--thy-radius);
  font-weight: 820;
  text-decoration: none;
}
.thy-button--primary {
  background: var(--thy-ink);
  color: var(--thy-white);
}
.thy-button--secondary {
  background: var(--thy-white);
  color: var(--thy-ink);
}
.thy-hero__art {
  position: relative;
  min-height: clamp(390px, 46vw, 620px);
  display: grid;
  place-items: center;
  margin-right: calc((100vw - min(var(--thy-max), calc(100vw - 40px))) / -2);
  overflow: visible;
}
.thy-hero__art::before {
  content: "";
  position: absolute;
  inset: 8% 0 4% 4%;
  background:
    radial-gradient(circle at 50% 46%, rgba(204,95,52,.13), transparent 30%),
    radial-gradient(circle at 58% 50%, rgba(22,22,21,.08), transparent 50%);
  filter: blur(28px);
  opacity: .9;
}
.thy-hero__art img {
  position: relative;
  width: min(100%, 820px);
  padding: 0;
  transform: translateX(-2%);
  filter: drop-shadow(0 34px 34px rgba(22,22,21,.22));
}
.thy-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 42px;
  border: 1px solid var(--thy-line);
  background: var(--thy-line);
}
.thy-status div {
  min-height: 116px;
  padding: 20px;
  background: var(--thy-paper);
}
.thy-status strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}
.thy-status span {
  display: block;
  margin-top: 8px;
  color: var(--thy-ink-soft);
  font-size: 14px;
}

.thy-section { padding: clamp(52px, 7vw, 94px) 0; border-bottom: 1px solid var(--thy-line); }
.thy-section--dark { background: var(--thy-ink); color: var(--thy-white); }
.thy-section--dark .thy-muted { color: rgba(255,253,248,.7); }
.thy-section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  gap: 28px;
  align-items: end;
  margin-bottom: 34px;
}
.thy-section h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 70px);
  line-height: .98;
  font-weight: 870;
}
.thy-muted { color: var(--thy-ink-soft); }

.thy-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--thy-line);
  border: 1px solid var(--thy-line);
}
.thy-feature {
  min-height: 250px;
  padding: 24px;
  background: var(--thy-white);
}
.thy-feature b {
  display: inline-flex;
  margin-bottom: 26px;
  color: var(--thy-accent-strong);
  font-size: 13px;
  text-transform: uppercase;
}
.thy-feature h3 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.05;
}
.thy-feature p { margin: 0; color: var(--thy-ink-soft); }

.thy-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.thy-showcase__text h2 { margin-bottom: 18px; }
.thy-showcase__image {
  min-height: 340px;
  display: grid;
  place-items: center;
  border-radius: var(--thy-radius);
  background: linear-gradient(135deg, rgba(255,253,248,.92), rgba(214,204,191,.58));
  overflow: hidden;
}
.thy-showcase__image img {
  width: min(100%, 520px);
  padding: 20px;
  filter: drop-shadow(0 24px 26px rgba(22,22,21,.17));
}

.thy-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.24);
}
.thy-link-card {
  min-height: 160px;
  padding: 22px;
  background: rgba(255,255,255,.06);
  text-decoration: none;
}
.thy-link-card:hover { background: rgba(255,255,255,.12); }
.thy-link-card strong { display: block; font-size: 22px; }
.thy-link-card span { display: block; margin-top: 10px; color: rgba(255,253,248,.68); }

.thy-posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--thy-line);
  border: 1px solid var(--thy-line);
}
.thy-post {
  padding: 24px;
  background: var(--thy-white);
}
.thy-post time {
  color: var(--thy-accent-strong);
  font-size: 13px;
  font-weight: 800;
}
.thy-post h3 { margin: 14px 0 10px; font-size: 24px; line-height: 1.08; }
.thy-post a { text-decoration: none; }

.thy-page {
  max-width: 860px;
  padding: 64px 0 86px;
}
.thy-page h1 {
  margin: 0 0 26px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: .96;
}
.thy-page p,
.thy-page li {
  color: var(--thy-ink-soft);
  font-size: 18px;
}

.thy-footer {
  flex-shrink: 0;
  padding: 42px 0;
  background: var(--thy-paper-deep);
}
.thy-footer__grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--thy-ink-soft);
}
.thy-footer a { font-weight: 760; }

.thy-cookie {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px;
  display: none;
  gap: 16px;
  align-items: center;
  background: var(--thy-ink);
  color: var(--thy-white);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--thy-radius);
  box-shadow: var(--thy-shadow);
}
.thy-cookie.is-visible { display: flex; }
.thy-cookie p { margin: 0; color: rgba(255,253,248,.76); font-size: 14px; }
.thy-cookie a { color: var(--thy-white); font-weight: 800; }
.thy-cookie button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--thy-white);
  border-radius: var(--thy-radius);
  background: var(--thy-white);
  color: var(--thy-ink);
  font-weight: 800;
}

@media (max-width: 920px) {
  .thy-hero__grid,
  .thy-section__head,
  .thy-showcase {
    grid-template-columns: 1fr;
  }
  .thy-feature-grid,
  .thy-link-grid,
  .thy-posts {
    grid-template-columns: 1fr 1fr;
  }
  .thy-status { grid-template-columns: 1fr; }
  .thy-hero__art {
    min-height: 340px;
    margin-right: 0;
  }
  .thy-hero__art img {
    width: min(100%, 660px);
    transform: none;
  }
}

@media (max-width: 680px) {
  .thy-shell { width: min(100% - 28px, var(--thy-max)); }
  .thy-header__inner { min-height: 72px; }
  .thy-brand__mark { width: 42px; height: 42px; font-size: 14px; }
  .thy-brand strong { font-size: 22px; }
  .thy-brand small { max-width: 220px; font-size: 12px; }
  .thy-menu-toggle { display: inline-flex; }
  .thy-menu-panel {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% + 8px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--thy-line);
    border-radius: 8px;
    background: var(--thy-white);
    box-shadow: var(--thy-shadow);
  }
  body.is-menu-open .thy-menu-panel { display: flex; }
  .thy-nav { flex-direction: column; align-items: stretch; width: 100%; }
  .thy-nav a { justify-content: space-between; min-height: 44px; padding: 0 12px; background: var(--thy-paper); }
  .thy-lang-select { justify-content: space-between; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--thy-line); }
  .thy-lang-select select { flex: 1; max-width: none; }
  .thy-feature-grid,
  .thy-link-grid,
  .thy-posts {
    grid-template-columns: 1fr;
  }
  .thy-actions { flex-direction: column; }
  .thy-button { width: 100%; }
  .thy-footer__grid { flex-direction: column; }
  .thy-cookie { align-items: stretch; flex-direction: column; }
}
