:root {
  color-scheme: light;
  --jade: #006c5c;
  --jade-deep: #003e34;
  --jade-wash: #61f4d8;
  --brass: #785a00;
  --brass-wash: #ffd16c;
  --canvas: #fbfdfa;
  --ink: #191c1b;
  --quiet-ink: #3f4946;
  --surface-low: #f0f5f3;
  --surface: #e5eae7;
  --surface-high: #dfe4e2;
  --outline: #bec9c5;
  --logo-ink: #0f172a;
  --shadow: 0 10px 40px rgba(25, 28, 27, 0.08), 0 4px 12px rgba(25, 28, 27, 0.04);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --jade: #61f4d8;
  --jade-deep: #00382f;
  --jade-wash: #08c1a6;
  --brass: #ffd16c;
  --brass-wash: #584400;
  --canvas: #0e0e0e;
  --ink: #ffffff;
  --quiet-ink: #adaaaa;
  --surface-low: #131313;
  --surface: #20201f;
  --surface-high: #262626;
  --outline: #484847;
  --logo-ink: #e4e4e7;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}

button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

.page {
  width: min(100% - 48px, 1184px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 40px;
  height: 40px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--outline) 42%, transparent);
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover { background: var(--surface); transform: translateY(-1px); }
.theme-toggle:focus-visible, .project-link:focus-visible, .brand:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

main {
  align-self: center;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(290px, .95fr);
  gap: clamp(48px, 10vw, 132px);
  align-items: center;
  padding: clamp(58px, 13vh, 148px) 0 clamp(72px, 13vh, 150px);
}

.introduction { position: relative; z-index: 1; }

h1 {
  max-width: 610px;
  margin: 0;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(48px, 6.25vw, 88px);
  font-weight: 760;
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.intro-copy {
  max-width: 46ch;
  margin: 25px 0 0;
  color: var(--quiet-ink);
  font-size: 16px;
  line-height: 1.7;
}

.projects { margin-top: 46px; }

.project-link {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: min(100%, 548px);
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--outline) 42%, transparent);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(25, 28, 27, .04);
  transition: transform 200ms cubic-bezier(.22, 1, .36, 1), background-color 200ms ease, box-shadow 200ms ease;
}

.project-link::after {
  content: "";
  position: absolute;
  inset: auto -12% -120% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--jade-wash) 35%, transparent);
  transition: transform 400ms cubic-bezier(.22, 1, .36, 1);
}

.project-link:hover { transform: translateY(-4px); background: var(--surface-high); box-shadow: var(--shadow); }
.project-link:hover::after { transform: translate(-22px, -22px); }

.project-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: var(--jade-deep);
  color: var(--jade-wash);
}

.project-symbol svg { width: 35px; height: 35px; }
.project-info, .arrow { position: relative; z-index: 1; }
.project-name { display: block; font-family: Manrope, ui-sans-serif, system-ui, sans-serif; font-size: 19px; font-weight: 720; letter-spacing: -.025em; }
.project-description { display: block; margin-top: 2px; color: var(--quiet-ink); font-size: 13px; line-height: 1.45; }
.arrow { color: var(--jade); transition: transform 180ms ease; }
.project-link:hover .arrow { transform: translateX(3px); }

.future-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0 4px;
  color: var(--quiet-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.future-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }

.orbit {
  position: relative;
  min-height: 430px;
  isolation: isolate;
  /* Clip decorative rings/mark to the box so they can never bleed into
     neighbouring content once the layout narrows on small screens. */
  overflow: hidden;
}

.orbit::before {
  content: "";
  position: absolute;
  top: 6%;
  right: -18%;
  width: min(43vw, 520px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--jade) 54%, transparent);
  border-radius: 48% 52% 50% 50% / 56% 46% 54% 44%;
  transform: rotate(-22deg);
}

.orbit::after {
  content: "";
  position: absolute;
  top: 31%;
  right: 12%;
  width: min(22vw, 258px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--jade) 27%, transparent);
  border-radius: 50%;
}

.orbit-mark {
  position: absolute;
  top: 27%;
  left: 7%;
  z-index: 1;
  width: clamp(146px, 18vw, 226px);
  transform: rotate(-8deg);
  animation: settle 900ms cubic-bezier(.22, 1, .36, 1) both;
}

.brass-dot {
  position: absolute;
  top: 21%;
  right: 9%;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--brass-wash);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--brass-wash) 22%, transparent);
}

.location-note {
  position: absolute;
  right: 3%;
  bottom: 4%;
  max-width: 14ch;
  margin: 0;
  color: var(--quiet-ink);
  font-size: 13px;
  line-height: 1.55;
}

footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  color: var(--quiet-ink);
  font-size: 12px;
  line-height: 1.5;
}

.footer-line { display: flex; align-items: center; gap: 8px; }
.footer-line::before { content: ""; width: 18px; height: 1px; background: var(--jade); }
footer a { text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; }
footer a:hover { color: var(--jade); }

@keyframes settle {
  from { opacity: 0; transform: rotate(-13deg) translateY(18px); }
  to { opacity: 1; transform: rotate(-8deg) translateY(0); }
}

@media (max-width: 720px) {
  .page { width: min(100% - 32px, 560px); padding-top: 20px; }
  main { grid-template-columns: 1fr; gap: 24px; padding: 68px 0 72px; }
  h1 { font-size: clamp(47px, 14.2vw, 70px); }
  .intro-copy { margin-top: 20px; }
  .projects { margin-top: 35px; }

  /* .orbit becomes a short decorative strip above the intro on narrow
     viewports. All the offsets below are sized in vw/% (with a px cap)
     instead of fixed px so the ring, mark and dot scale down together
     and stay inside the now-clipped .orbit box instead of overflowing
     into the header or intro copy. */
  .orbit { order: -1; min-height: 173px; margin: 0 -6px -3px; }
  .orbit::before { top: -60%; right: -10%; width: min(72vw, 310px); }
  .orbit::after { display: none; }
  .orbit-mark { top: -10%; left: 4%; width: min(30vw, 137px); }
  .brass-dot { top: 20%; right: 14%; width: 14px; height: 14px; }
  .location-note { right: 5%; bottom: 0; max-width: 40%; font-size: 12px; }
}

@media (max-width: 440px) {
  .project-link { grid-template-columns: 49px minmax(0, 1fr) auto; gap: 13px; padding: 14px; }
  .project-symbol { width: 49px; height: 49px; }
  .project-symbol svg { width: 29px; height: 29px; }
  .project-name { font-size: 17px; }
  .project-description { font-size: 12px; }
  footer { align-items: flex-start; flex-direction: column; gap: 7px; }

  /* Very narrow phones: shrink the orbit strip further and drop the
     caption rather than let it wrap awkwardly under the ring. */
  .orbit { min-height: 132px; }
  .orbit::before { top: -48%; width: min(60vw, 230px); }
  .orbit-mark { width: min(26vw, 110px); }
  .location-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
