@font-face {
  font-family: Geist;
  src: url("fonts/geist.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0813;
  --surface: #14101f;
  --raised: #20192f;
  --line: #383046;
  --text: #f7f3ff;
  --muted: #beb3ce;
  --accent: #dfc5ff;
  --bright: #f5e5ff;
  --radius: 22px;
  --gutter: clamp(18px, 5vw, 78px);
  --width: 1240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 68% 0, #181024 0, transparent 36rem), var(--bg);
  color: var(--text);
  font: 16px/1.65 Geist, system-ui, sans-serif;
}

a { color: var(--accent); text-underline-offset: .25em; }
a:hover { color: white; }
:focus-visible { outline: 2px solid #e8caff; outline-offset: 4px; }

.shell {
  width: min(var(--width), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: var(--gutter);
  padding: 8px 14px;
  transform: translateY(calc(-100% - 12px));
  border-radius: 8px;
  background: var(--bright);
  color: var(--bg);
}
.skip-link:focus { transform: none; }

.topbar { position: relative; z-index: 2; padding-block: 18px; }
.page-home .topbar { position: absolute; inset: 0 0 auto; }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 8px 10px 8px 18px;
  border: 1px solid #d5b9ef2c;
  border-radius: 20px;
  background: #100b19d9;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 680;
  letter-spacing: -.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #f5dbff, #ac76e7 44%, #392254 80%);
  box-shadow: 0 0 16px #ab75e656;
}

.brand-mark::after {
  position: absolute;
  inset: 32% -6px;
  content: "";
  transform: rotate(-32deg);
  border: 1px solid #f1d8ff;
  border-radius: 50%;
}

.primary-nav { display: flex; align-items: center; gap: 3px; }

.primary-nav a {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 6px clamp(9px, 2vw, 21px);
  border-radius: 13px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 560;
  text-decoration: none;
}

.primary-nav a:is(:hover, [aria-current]) {
  background: #33253e;
  color: var(--text);
}

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(2.6rem, 6vw, 6.2rem); font-weight: 630; letter-spacing: -.073em; }
h2 { font-size: clamp(1.7rem, 4vw, 3.2rem); font-weight: 630; letter-spacing: -.055em; }
h3 { font-size: 1.18rem; font-weight: 630; }
p { margin: .5em 0 1em; color: var(--muted); }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: clamp(625px, 54vw, 830px);
  background: #110918;
}

.hero::before, .hero::after { position: absolute; inset: 0; content: ""; z-index: -1; }

.hero::before {
  background: url("art/ringed-world.jpg") 64% center / cover no-repeat;
  animation: settle 1.3s cubic-bezier(.2,.65,.25,1) both;
}

.hero::after {
  background: linear-gradient(0deg, var(--bg) 0%, #0b081300 23%),
              linear-gradient(90deg, #0b0813cd 0%, #0b081366 30%, #0b081300 67%);
}

@keyframes settle { from { transform: scale(1.045); } to { transform: scale(1); } }

.hero-copy { padding-block: 148px 100px; }

.hero h1 {
  margin: 0;
  font-size: clamp(4.15rem, 8.6vw, 9.5rem);
  line-height: .87;
  text-wrap: nowrap;
  text-shadow: 0 3px 36px #0b08137a;
}

.hero h1 em {
  color: var(--accent);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.14em;
  font-weight: 400;
  letter-spacing: -.02em;
}

.hero p {
  max-width: 32ch;
  margin: 28px 0 22px;
  color: #e5d9ed;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.actions, .choices { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 14px; }

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #635272;
  border-radius: 11px;
  background: #271d35;
  color: var(--text);
  font: inherit;
  font-weight: 580;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.button:hover, button:hover { border-color: #9f82b8; background: #3a2a4c; color: white; }
.primary, button[aria-pressed=true] { border-color: var(--accent); background: var(--accent); color: #22102f; }
.primary:hover, button[aria-pressed=true]:hover { border-color: #f2e3ff; background: #f2e3ff; color: #22102f; }
button:disabled { opacity: .53; cursor: default; }
.hero .button { min-height: 50px; padding-inline: 21px; border-radius: 13px; }
.hero .primary { box-shadow: 0 7px 30px #9662d73a; }
.hero-secondary { background: #21182b98; }
.quiet { background: transparent; }

.home-section { margin-block: clamp(48px, 8vw, 108px); }
.practice-section { margin-top: clamp(16px, 3.8vw, 50px); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.section-heading h2 { margin: 0; }
.section-heading .button { flex: none; }

.page-hero {
  isolation: isolate;
  display: flex;
  align-items: end;
  min-height: clamp(202px, 26vw, 320px);
  margin: 12px 0 28px;
  padding: clamp(23px, 5.5vw, 60px);
  border: 1px solid #ae83d747;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #130b1b 3%, #130b1bd9 36%, #130b1b44 100%),
              url("art/ringed-world.jpg") 66% 43% / cover no-repeat, var(--surface);
}

.journal-hero { background-position: center, 75% 59%; }
.page-hero h1 { margin-bottom: .15em; }
.page-hero p, .workspace-title p { max-width: 52ch; margin: 0; color: #e1d3eb; }

.tool-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 40px; }

.tool-jumps a, .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1b1427;
  color: var(--accent);
  font-size: .92rem;
  text-decoration: none;
}

.tool-jumps a:hover, .back-link:hover { border-color: #9f82b8; background: #30243c; }

.tool-category { margin-block: 40px; scroll-margin-top: 20px; }
.tool-category h2 { margin-bottom: 14px; font-size: clamp(1.5rem, 3vw, 2rem); }

.tool-directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.tool-tile {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: start;
  gap: 19px;
  min-height: 215px;
  padding: clamp(17px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(ellipse at 100% 0, #302142 0, transparent 66%), var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}

.tool-tile::after {
  position: absolute;
  z-index: -1;
  top: -59px;
  right: -24px;
  width: 168px;
  height: 128px;
  border: 1px solid #d8b8ff34;
  border-radius: 50%;
  box-shadow: 0 0 0 18px #d8b8ff0c, 0 0 0 37px #d8b8ff0a;
  transform: rotate(-31deg);
  content: "";
}

.tool-tile:nth-child(3n+2) { background: radial-gradient(ellipse at 100% 0, #292647 0, transparent 66%), var(--surface); }
.tool-tile:nth-child(3n+3) { background: radial-gradient(ellipse at 100% 0, #39243a 0, transparent 66%), var(--surface); }
.tool-tile:hover { transform: translateY(-3px); border-color: #bd9fda; }
.tool-tile h3 { margin-bottom: 6px; font-size: clamp(1.13rem, 2vw, 1.44rem); }
.tool-tile p { margin: 0; line-height: 1.5; }

.tool-symbol {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid #9473b67a;
  border-radius: 15px;
  background: #211831;
  color: #e5cfff;
  font: 600 26px/1 system-ui, sans-serif;
}

.tile-action { color: var(--accent); font-size: .94rem; font-weight: 620; }

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

.journal-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s ease;
}

.journal-card:hover { border-color: #bd9fda; }
.journal-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--raised); }
.journal-copy { min-width: 0; padding: clamp(16px, 2vw, 24px); }
.journal-copy h3 { margin: .45em 0 0; line-height: 1.22; }
.journal-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.journal-grid-featured .journal-card:first-child {
  isolation: isolate;
  grid-column: span 2;
  grid-row: span 2;
  justify-content: end;
  min-height: 395px;
  background: radial-gradient(ellipse at 80% 10%, #332448, transparent 80%), var(--surface);
}

.journal-grid-featured .journal-card:first-child .journal-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  height: 100%;
}

.journal-grid-featured .journal-card:first-child::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, #100a19 4%, #100a19dc 30%, transparent 76%);
  content: "";
}

.journal-grid-featured .journal-card:first-child .journal-copy { padding: clamp(20px, 4vw, 40px); }
.journal-grid-featured .journal-card:first-child h3 { font-size: clamp(1.8rem, 4vw, 3.25rem); }
.journal-grid-featured .journal-card:nth-child(2),
.journal-grid-featured .journal-card:nth-child(3) { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.journal-grid-featured .journal-card:nth-child(2) .journal-image,
.journal-grid-featured .journal-card:nth-child(3) .journal-image { height: 100%; object-fit: cover; }
.journal-grid-featured .journal-card:nth-child(2) .journal-copy:only-child,
.journal-grid-featured .journal-card:nth-child(3) .journal-copy:only-child { grid-column: 1 / -1; }

time, small { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

.article { max-width: 960px; margin: 26px auto 0; }
.article-heading { max-width: 860px; padding-block: clamp(12px, 3vw, 38px) 25px; }
.article-heading h1 {
  margin: 16px 0 12px;
  font-size: clamp(2.5rem, 5.75vw, 5.2rem);
  overflow-wrap: anywhere;
}
.article-cover, .feedback-image {
  display: block;
  width: 100%;
  max-height: 540px;
  margin: 16px 0 38px;
  border-radius: var(--radius);
  background: #0a0710;
  object-fit: contain;
}
.article-cover { border: 1px solid var(--line); }
.prose { max-width: 74ch; margin-inline: auto; font-size: clamp(1rem, 1.6vw, 1.16rem); line-height: 1.75; overflow-wrap: break-word; }
.prose :is(img, iframe, video) { max-width: 100%; }
.prose img { height: auto; border-radius: 12px; }
.prose iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }
.prose p { margin: 0 0 1em; color: #e2d9ec; }

.workspace-shell { max-width: 1050px; margin-inline: auto; }
.tool-workspace-header { margin-block: 24px 24px; }
.workspace-title { display: flex; align-items: flex-start; gap: 17px; margin-top: 26px; }
.workspace-title h1 { margin-bottom: .22em; font-size: clamp(2rem, 6vw, 4.65rem); }
.workspace-title .tool-symbol { margin-top: 5px; }
.tool-workspace, .panel {
  min-width: 0;
  padding: clamp(18px, 4vw, 40px);
  border: 1px solid #614a747d;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at top right, #37244f 0, transparent 62%), #161020;
}
.tool-workspace { min-height: 175px; }
.tool-workspace h2 { font-size: clamp(1.35rem, 3.8vw, 2.2rem); }
.tool-workspace .form { max-width: 590px; }
.tool-workspace .actions { margin-bottom: 0; }
.tool-workspace summary { color: var(--accent); cursor: pointer; }
.tool-progress {
  display: block;
  overflow: hidden;
  width: min(100%, 360px);
  height: 8px;
  margin: 15px 0 20px;
  border: 0;
  border-radius: 999px;
  background: #39294c;
  accent-color: var(--accent);
}
.tool-progress::-webkit-progress-bar { background: #39294c; }
.tool-progress::-webkit-progress-value { background: var(--accent); }
.tool-progress::-moz-progress-bar { background: var(--accent); }

.target-pair, .pick-targets, .tool-option-grid { display: grid; gap: 12px; margin: 18px 0; }
.target-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-targets { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.tool-option-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.target-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #15101f; }
.target-card :is(details, .actions) { margin-top: 12px; }

.tool-option { display: grid; align-content: start; gap: 6px; min-height: 108px; padding: 17px; text-align: left; }
.tool-option strong { font-size: 1.06rem; }
.tool-option span { color: var(--muted); font-size: .94rem; font-weight: 400; }
.tool-back { margin-bottom: 16px; font-size: .92rem; }

.answer-grid { display: grid; gap: 8px; width: min(100%, 560px); margin: 14px 0; }
.digit-answers { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gestalt-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.answer-grid button { padding: 7px; overflow-wrap: anywhere; }
.reference { color: var(--bright); font: 650 clamp(1.8rem, 5vw, 3rem)/1.2 ui-monospace, monospace; letter-spacing: .13em; }
.notice { color: var(--bright); white-space: pre-line; }

.grid-overflow { overflow: auto; margin-top: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #100b19; }
.number-grid { display: grid; grid-template-columns: repeat(100, 34px); width: max-content; gap: 3px; }
.number-grid button { min-height: 34px; padding: 1px; border-radius: 5px; font-size: .8rem; }

.heading { margin: 40px 0 25px; }
.heading p { max-width: 66ch; }
.panel { margin-bottom: 20px; }
.form { display: grid; gap: 15px; max-width: 850px; }
label { display: grid; gap: 6px; }
label.inline { display: flex; align-items: center; gap: 8px; }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #655370;
  border-radius: 9px;
  background: #110b1b;
  color: var(--text);
  font: inherit;
}
input[type=checkbox] { width: auto; min-height: auto; }
.form button { justify-self: start; }
.record-list { padding-left: 20px; }
.record-list li { margin: .5rem 0; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: clamp(55px, 9vw, 115px);
  padding: 26px 0 32px;
  border-top: 1px solid var(--line);
}
.site-footer > a:last-child { color: var(--muted); text-decoration: none; }
.site-footer > a:last-child:hover { color: var(--text); }

@media (max-width: 930px) {
  .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-grid-featured .journal-card:first-child { grid-row: auto; min-height: 330px; }
  .journal-grid-featured .journal-card:nth-child(2),
  .journal-grid-featured .journal-card:nth-child(3) { display: flex; }
  .journal-grid-featured .journal-card:nth-child(2) .journal-image,
  .journal-grid-featured .journal-card:nth-child(3) .journal-image { height: auto; }
}

@media (max-width: 700px) {
  .hero { min-height: 660px; min-height: min(730px, max(620px, 90svh)); align-items: end; }
  .hero::before { background-position: 72% top; background-size: auto 78%; }
  .hero::after {
    background: linear-gradient(0deg, var(--bg) 0%, #0b0813 9%, #0b0813db 31%, #0b081344 62%, #0b081344 100%);
  }
  .hero-copy { padding-block: 120px 55px; }
  .hero h1 { font-size: clamp(2.4rem, 11vw, 5rem); }
  .hero p { margin-block: 20px 14px; }
  .tool-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-hero { background-position: center, 74% center; }
}

@media (max-width: 480px) {
  .topbar { padding-block: 11px; }
  .topbar-inner { min-height: 54px; padding: 5px 5px 5px 10px; border-radius: 14px; }
  .topbar .brand { gap: 7px; font-size: .93rem; }
  .topbar .brand-mark { flex-basis: 16px; width: 16px; height: 16px; }
  .brand-mark::after { inset-inline: -4px; }
  .primary-nav { gap: 0; }
  .primary-nav a { min-height: 38px; padding-inline: 7px; font-size: .86rem; }
  .section-heading { align-items: start; flex-wrap: wrap; }
  .tool-directory, .target-pair, .journal-grid { grid-template-columns: 1fr; }
  .journal-grid-featured .journal-card:first-child { grid-column: auto; min-height: 290px; }
  .tool-tile { min-height: auto; grid-template: auto auto / auto minmax(0, 1fr); gap: 6px 13px; }
  .tool-tile .tool-symbol { grid-row: span 2; }
  .tile-action { grid-column: 2; }
  .gestalt-answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .topbar-inner { gap: 5px; }
  .primary-nav a { padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .tool-tile, .journal-card, .button, button { transition: none; }
  .tool-tile:hover { transform: none; }
}
