:root {
  color-scheme: light dark;

  --terracotta: #BE5C3B;
  --terracotta-deep: #96442A;
  --sage: #6F7F52;
  --sage-deep: #57623F;
  --gold: #D2992F;
  --bg: #F7F3EA;
  --ink: #3A2E22;

  --ink-soft: var(--sage-deep);
  --accent: var(--terracotta);
  --accent-deep: var(--terracotta-deep);
  --line: rgba(58, 46, 34, 0.14);
  --line-strong: var(--sage-deep);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --terracotta: #E28A61;
    --terracotta-deep: #C1613F;
    --sage: #9FAF80;
    --sage-deep: #82936A;
    --gold: #E5B858;
    --bg: #1E170F;
    --ink: #F2E9D9;

    --line: rgba(242, 233, 217, 0.14);
  }
}

:root[data-theme="dark"] {
  --terracotta: #E28A61;
  --terracotta-deep: #C1613F;
  --sage: #9FAF80;
  --sage-deep: #82936A;
  --gold: #E5B858;
  --bg: #1E170F;
  --ink: #F2E9D9;

  --line: rgba(242, 233, 217, 0.14);
}

.wordmark, .hero h1, section h2, .email-link {
  font-variation-settings: "SOFT" 40;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap, .site-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: block;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.01em;
}

nav a {
  margin-left: 28px;
  color: var(--ink-soft);
  font-size: 15px;
}

nav a:hover {
  color: var(--accent);
}

.theme-toggle {
  margin-left: 28px;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-icon-sun {
  display: none;
}

.theme-toggle.is-dark .theme-icon-sun {
  display: block;
}

.theme-toggle.is-dark .theme-icon-moon {
  display: none;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 88px;
  padding-bottom: 56px;
}

.hero-text {
  max-width: 680px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.22;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 26px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 32px;
}

.badge {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 3px;
}

.hero-cta {
  display: inline-block;
  border: 1px solid var(--accent);
  padding: 10px 22px;
  font-size: 15px;
  border-radius: 3px;
}

.hero-cta:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--bg);
  text-decoration: none;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

section h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: var(--ink);
  margin: 0 0 22px;
}

.work, .contact {
  padding-top: 56px;
  padding-bottom: 56px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.work p:not(.eyebrow) {
  max-width: 620px;
  margin: 0 0 18px;
}

.work p:last-child {
  margin-bottom: 0;
}

.mind {
  padding-top: 8px;
  padding-bottom: 56px;
}

.mind-layout {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 48px;
  align-items: center;
}

.mind-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.mind-stage.is-loaded {
  opacity: 1;
}

.mind-stage:active {
  cursor: grabbing;
}

.mind-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.mind-hint {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.6;
  pointer-events: none;
}

.mind-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: 24px;
  font-size: 14px;
  color: var(--ink-soft);
}

.mind-stage.is-fallback {
  opacity: 1;
}

.mind-stage.is-fallback canvas,
.mind-stage.is-fallback .mind-pin,
.mind-stage.is-fallback .mind-hint {
  display: none;
}

.mind-stage.is-fallback .mind-fallback {
  display: flex;
}

.mind-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  --pin-accent: var(--accent);
  transition: opacity 0.25s ease;
}

.mind-pin.is-occluded {
  opacity: 0.15;
  pointer-events: none;
}

.mind-pin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pin-accent);
  box-shadow: 0 0 0 2px var(--bg), 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.mind-pin-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--pin-accent);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mind-pin.is-active .mind-pin-dot {
  background: var(--pin-accent);
  transform: scale(1.25);
}

.mind-pin.is-active .mind-pin-ring,
.mind-pin:hover .mind-pin-ring {
  opacity: 0.55;
  transform: scale(1);
}

.mind-list {
  display: flex;
  flex-direction: column;
}

.mind-list-item {
  --item-accent: var(--accent);
  border-top: 1px solid var(--line);
}

.mind-list-item:first-child {
  border-top: none;
}

.mind-list-trigger {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 16px 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.mind-list-label {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  transition: color 0.3s ease;
}

.mind-list-item.is-active .mind-list-label {
  color: var(--item-accent);
}

.mind-list-sub {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.mind-list-desc {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  max-width: 440px;
  color: var(--ink-soft);
  font-size: 15px;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.35s ease;
}

.mind-list-item.is-active .mind-list-desc {
  max-height: 120px;
  opacity: 1;
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .mind-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .mind-stage {
    max-width: 320px;
    margin: 0 auto;
  }
}

.secondary {
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.secondary p {
  max-width: 560px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.contact p:not(.eyebrow) {
  max-width: 620px;
  margin: 0 0 14px;
}

.email-link {
  font-family: var(--serif);
  font-size: 19px;
}

footer {
  padding-top: 32px;
  padding-bottom: 40px;
  color: var(--ink-soft);
  font-size: 14px;
  background: var(--bg);
}

footer .credit {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.75;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.floating-node {
  --node-color: var(--terracotta);
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 220px;
  z-index: 20;
  pointer-events: none;
}

.floating-node svg {
  pointer-events: none;
  overflow: visible;
}

.floating-node-hit {
  pointer-events: all;
  cursor: pointer;
}

.floating-node-dot {
  animation: node-breathe 2.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.floating-node.is-dodging .floating-node-dot {
  animation: none;
}

.floating-node-ring {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.floating-node.is-caught .floating-node-ring {
  animation: node-ring 0.6s ease-out;
}

.floating-node.is-caught .floating-node-dot {
  animation: none;
}

.floating-node-petal {
  opacity: 0;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center bottom;
}

.floating-node-bloom-center {
  transform-box: fill-box;
  transform-origin: center;
}

.floating-node.is-caught .floating-node-petal {
  animation: fn-petal-bloom 1.3s ease forwards;
}

.floating-node-message {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.floating-node.is-caught .floating-node-message {
  opacity: 1;
}

@keyframes node-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

@keyframes fn-petal-bloom {
  0% { opacity: 0; transform: scale(0); }
  45% { opacity: 1; transform: scale(1.25); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.3); }
}

@keyframes node-ring {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 0; transform: scale(2.8); }
}

@media (max-width: 900px) {
  .floating-node {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-node {
    display: none;
  }
}

@media (max-width: 760px) {
  .hero {
    gap: 36px;
    padding-top: 64px;
    padding-bottom: 56px;
  }
  .hero-text {
    max-width: none;
  }
  .hero h1 {
    font-size: 30px;
  }
}
