:root {
  --bg-night: #06162b;
  --bg-sea: #10395a;
  --bg-mid: #1f5b7a;
  --sun: #f3cc4a;
  --sun-hot: #ef9e39;
  --ember: #c86f4f;
  --substack-orange: #ff6719;
  --ink: #e9eef5;
  --muted: #b8c8d9;
  --line: rgba(233, 238, 245, 0.2);
  --panel: rgba(10, 30, 52, 0.66);
  --panel-strong: rgba(8, 24, 42, 0.8);
  --shadow: 0 22px 44px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  background:
    radial-gradient(circle at 50% 52%, rgba(243, 204, 74, 0.84), rgba(243, 204, 74, 0.2) 26%, transparent 42%),
    radial-gradient(circle at 62% 42%, rgba(255, 103, 25, 0.34), transparent 36%),
    conic-gradient(from 152deg at 50% 58%, #0c2f4f, #1e6181, #bb6f52, #0f3858, #0a203a, #0c2f4f),
    linear-gradient(180deg, var(--bg-night) 0%, var(--bg-sea) 45%, #0a2038 100%);
  background-attachment: fixed;
}

.sweep {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.32;
  background:
    linear-gradient(146deg, transparent 30%, rgba(243, 204, 74, 0.38) 50%, transparent 70%),
    linear-gradient(23deg, transparent 18%, rgba(80, 154, 170, 0.24) 44%, transparent 68%),
    linear-gradient(198deg, transparent 60%, rgba(255, 103, 25, 0.22) 83%, transparent 100%);
  filter: blur(1.5px);
}

.site-header,
main,
.site-footer {
  width: min(1080px, calc(100% - 2.2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 22, 43, 0.66);
  backdrop-filter: blur(10px);
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-family: "Fraunces", "Iowan Old Style", serif;
  font-size: 1.08rem;
}

nav {
  display: flex;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

nav a:hover,
.text-link:hover {
  color: var(--substack-orange);
}

.hero {
  padding: 4.3rem 0 2rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
  font-family: "Fraunces", "Iowan Old Style", serif;
}

h1 {
  margin-top: 0.55rem;
  font-size: clamp(2rem, 5.6vw, 4.1rem);
  max-width: 17ch;
}

.hero > p {
  max-width: 66ch;
  margin-top: 1rem;
}

.hero-split {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.2rem;
  align-items: end;
}

.profile-wrap {
  margin: 0;
  justify-self: end;
}

.profile-photo {
  width: min(360px, 100%);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px 22px 10px 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.media-frame {
  margin: 0.5rem 0 0;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px 22px 10px 20px;
  background: rgba(9, 28, 48, 0.48);
}

.book-cover {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px 14px 6px 12px;
}

.service-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.service-card h3 {
  margin-top: 0.7rem;
}

.service-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px 14px 6px 12px;
  border: 1px solid var(--line);
  display: block;
}

.service-art {
  height: 110px;
  border-radius: 4px 14px 6px 12px;
  border: 1px solid var(--line);
  background-size: 160% 160%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.art-1 {
  background-image: linear-gradient(130deg, rgba(255, 103, 25, 0.46), rgba(16, 57, 90, 0.85), rgba(243, 204, 74, 0.3));
}

.art-2 {
  background-image: linear-gradient(130deg, rgba(31, 91, 122, 0.86), rgba(200, 111, 79, 0.36), rgba(9, 28, 48, 0.9));
}

.art-3 {
  background-image: linear-gradient(130deg, rgba(243, 204, 74, 0.44), rgba(12, 47, 79, 0.88), rgba(255, 103, 25, 0.22));
}

.art-4 {
  background-image: linear-gradient(130deg, rgba(16, 57, 90, 0.95), rgba(31, 91, 122, 0.72), rgba(243, 204, 74, 0.24));
}

.art-5 {
  background-image: linear-gradient(130deg, rgba(200, 111, 79, 0.54), rgba(9, 28, 48, 0.9), rgba(243, 204, 74, 0.3));
}

.art-6 {
  background-image: linear-gradient(130deg, rgba(31, 91, 122, 0.82), rgba(243, 204, 74, 0.3), rgba(16, 57, 90, 0.95));
}

.art-7 {
  background-image: linear-gradient(130deg, rgba(255, 103, 25, 0.4), rgba(12, 47, 79, 0.86), rgba(31, 91, 122, 0.64));
}

.art-8 {
  background-image: linear-gradient(130deg, rgba(243, 204, 74, 0.46), rgba(200, 111, 79, 0.44), rgba(10, 30, 52, 0.92));
}

.art-9 {
  background-image: linear-gradient(130deg, rgba(16, 57, 90, 0.94), rgba(255, 103, 25, 0.28), rgba(31, 91, 122, 0.72));
}

.art-10 {
  background-image: linear-gradient(130deg, rgba(12, 47, 79, 0.92), rgba(243, 204, 74, 0.32), rgba(200, 111, 79, 0.42));
}

.cta-row {
  margin-top: 1.35rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.62rem 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: rgba(8, 26, 44, 0.58);
}

.btn.solid {
  color: #102640;
  background: linear-gradient(135deg, var(--sun) 0%, var(--sun-hot) 100%);
  border-color: rgba(243, 204, 74, 0.9);
}

.btn:hover {
  transform: translateY(-1px);
}

.panel {
  margin: 1.15rem 0;
  padding: 1.25rem;
  border-radius: 8px 26px 12px 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, transparent 0 72%, rgba(255, 103, 25, 0.1) 87%, transparent 100%);
}

.panel.deep {
  background: var(--panel-strong);
}

h2 {
  margin-top: 0.2rem;
  font-size: clamp(1.35rem, 2.8vw, 2.2rem);
}

.panel p {
  max-width: 72ch;
}

.panel-lead {
  color: #d9e6f4;
}

.tag-row {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.context-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.context-card {
  background: rgba(7, 25, 43, 0.58);
}

.context-list {
  margin: 0.55rem 0 0;
  padding-left: 1rem;
}

.context-list li {
  margin: 0.33rem 0;
  color: #dce6f2;
}

.tag {
  display: inline-block;
  padding: 0.34rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 24, 42, 0.52);
  color: #f0df9a;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.card-row {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 4px 16px 6px 14px;
  padding: 0.9rem;
  background: rgba(9, 28, 48, 0.52);
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.card p {
  margin: 0;
  color: #dce6f2;
  font-size: 0.94rem;
}

.service-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: rgba(243, 204, 74, 0.65);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.scroll-strip {
  margin-top: 0.9rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 300px);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scroll-snap-type: x mandatory;
}

.compact-row {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.service-grid-simple .card p {
  max-width: 46ch;
}

.strip-card {
  scroll-snap-align: start;
  min-height: 180px;
  transition: transform 0.28s ease, border-color 0.28s ease;
}

.strip-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 103, 25, 0.75);
}

.expand {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: rgba(8, 24, 42, 0.45);
}

.expand summary {
  cursor: pointer;
  font-weight: 600;
  color: #e7dba1;
}

.expand p {
  margin-top: 0.45rem;
}

.toc-direction {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.simple-columns {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
}

.simple-columns h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.simple-columns ul {
  margin: 0;
  padding-left: 1rem;
}

.simple-columns li {
  margin: 0.3rem 0;
  color: #dce6f2;
}

.toc-book-visual {
  position: relative;
}

.toc-book-visual .toc-map {
  max-height: 520px;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.toc-overlay-grid {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.8rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.45rem;
}

.toc-overlay-grid span {
  display: block;
  text-align: center;
  padding: 0.34rem 0.5rem;
  border: 1px solid rgba(233, 238, 245, 0.45);
  border-radius: 999px;
  background: rgba(7, 26, 45, 0.72);
  color: #f0df9a;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.shift-map {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.shift-item {
  border: 1px solid var(--line);
  border-radius: 8px 18px 10px 14px;
  padding: 0.75rem;
  background: rgba(8, 24, 42, 0.5);
}

.shift-item h3 {
  margin: 0;
  font-size: 0.98rem;
}

.shift-item p {
  margin-top: 0.35rem;
  font-size: 0.91rem;
}

.toc-list {
  margin: 0.9rem 0 0.6rem;
  padding-left: 1.15rem;
}

.toc-list li {
  margin: 0.5rem 0;
  color: #dce6f2;
}

.toc-map-wrap {
  margin: 0.85rem 0 0;
}

.toc-map {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px 20px 8px 16px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.interactive-direction .toc-step {
  position: relative;
  overflow: hidden;
}

.hover-step {
  min-height: 118px;
  padding-bottom: 1.2rem;
}

.hover-step:focus {
  outline: 2px solid rgba(243, 204, 74, 0.85);
  outline-offset: 2px;
}

.hover-step .micro {
  color: #ecf2fa;
  margin-top: 0.35rem;
  transition: opacity 0.25s ease;
}

.step-detail {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.6rem;
  padding: 0.55rem 0.62rem;
  border: 1px solid rgba(243, 204, 74, 0.45);
  border-radius: 7px;
  background: linear-gradient(120deg, rgba(7, 25, 43, 0.95), rgba(16, 57, 90, 0.86));
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.step-detail p {
  font-size: 0.9rem;
  line-height: 1.45;
}

.hover-step:hover .step-detail,
.hover-step:focus .step-detail,
.hover-step:focus-within .step-detail {
  opacity: 1;
  transform: translateY(0);
}

.hover-step:hover .micro,
.hover-step:focus .micro,
.hover-step:focus-within .micro {
  opacity: 0.15;
}

.toc-step,
.toc-outcome {
  transition: transform 0.32s ease, border-color 0.32s ease, box-shadow 0.32s ease;
}

.toc-step:hover,
.toc-outcome:hover {
  transform: translateX(8px) translateY(-3px);
  border-color: rgba(255, 103, 25, 0.75);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.33);
}

.toc-arrow {
  justify-self: center;
  color: #f3cc4a;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.9;
}

.toc-outcome {
  border-color: rgba(243, 204, 74, 0.68);
  background: linear-gradient(120deg, rgba(16, 57, 90, 0.8), rgba(243, 204, 74, 0.14));
}

.direction-pairs {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
}

.pair {
  border: 1px solid var(--line);
  background: rgba(8, 24, 42, 0.5);
  border-radius: 8px 20px 10px 16px;
  padding: 0.7rem 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
}

.pair span:first-child {
  color: #b7c9dd;
}

.pair span:last-child {
  color: #f3cc4a;
}

.cycle-panel {
  overflow: visible;
}

.cycle-grid {
  position: relative;
  min-height: 700px;
  margin-top: 1rem;
}

.cycle-node {
  position: absolute;
  width: min(280px, 42vw);
  transition: transform 0.35s ease, border-color 0.35s ease;
  animation: drift 7s ease-in-out infinite;
}

.cycle-node:hover {
  transform: scale(1.05) translateY(-10px) !important;
  border-color: rgba(255, 103, 25, 0.75);
  z-index: 10;
}

.cycle-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  border-radius: 999px;
  border: 1px solid rgba(243, 204, 74, 0.68);
  background: radial-gradient(circle at 50% 45%, rgba(243, 204, 74, 0.28), rgba(6, 22, 43, 0.82));
  display: grid;
  place-items: center;
  text-align: center;
  font-family: "Fraunces", "Iowan Old Style", serif;
  color: #f3e7b1;
  line-height: 1.2;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.n1 { left: calc(50% - 140px); top: 4%; animation-delay: -0.8s; }
.n2 { right: 8%; top: 20%; animation-delay: -2s; }
.n3 { right: 8%; bottom: 20%; animation-delay: -3.1s; }
.n4 { left: calc(50% - 140px); bottom: 4%; animation-delay: -4.2s; }
.n5 { left: 8%; bottom: 20%; animation-delay: -5.3s; }
.n6 { left: 8%; top: 20%; animation-delay: -6.4s; }

.text-link {
  color: var(--substack-orange);
  text-decoration: none;
  font-weight: 600;
}

.fine-print {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  margin-top: 1rem;
  padding: 2rem 0 2.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer a {
  margin-right: 1rem;
  text-decoration: none;
  color: var(--muted);
}

.post-grid .card:nth-child(odd) {
  transform: none;
}

.post-grid .card:nth-child(even) {
  transform: none;
}

.tilt-a {
  transform: none;
}

.tilt-b {
  transform: none;
}

.tilt-c {
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s ease forwards;
}

.site-header {
  animation-delay: 0.04s;
}

.hero {
  animation-delay: 0.1s;
}

.panel:nth-of-type(1) {
  animation-delay: 0.16s;
}

.panel:nth-of-type(2) {
  animation-delay: 0.22s;
}

.panel:nth-of-type(3) {
  animation-delay: 0.28s;
}

.panel:nth-of-type(4) {
  animation-delay: 0.34s;
}

.site-footer {
  animation-delay: 0.4s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
  100% { transform: translateY(0) rotate(-0.5deg); }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 2.8rem;
  }

  .hero-split {
    grid-template-columns: 1fr;
  }

  .profile-wrap {
    justify-self: start;
  }

  .cycle-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .cycle-node {
    position: static;
    width: 100%;
    animation: none;
    transform: none !important;
  }

  .cycle-core {
    position: static;
    transform: none;
    margin: 0.4rem auto;
  }

  .toc-overlay-grid {
    position: static;
    margin-top: 0.6rem;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .step-detail {
    position: static;
    opacity: 1;
    transform: none;
    margin-top: 0.6rem;
    pointer-events: auto;
  }

  .hover-step .micro {
    opacity: 1 !important;
  }
}
