:root {
  --bg: #0b0d10;
  --grid-line: rgba(231, 232, 222, 0.08);
  --grid-highlight: rgba(228, 230, 210, 0.2);
  --text-primary: #f2f3ea;
  --text-secondary: #d3d5c5;
  --focus: #f4f6d5;
  --footer-icon: #e4e6d7;
  --footer-icon-hover: #ffffff;
  --font-ui:
    ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  --font-heading: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mouse-x: 50vw;
  --mouse-y: 50vh;
  --home-links-shift-y: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
  color: var(--text-primary);
  background: var(--bg);
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
  line-height: 1.5;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.grid-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    radial-gradient(
      circle 420px at var(--mouse-x) var(--mouse-y),
      var(--grid-highlight),
      transparent 72%
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 31px,
      var(--grid-line) 31px,
      var(--grid-line) 32px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      var(--grid-line) 31px,
      var(--grid-line) 32px
    );
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main,
.home-main {
  flex: 1;
  width: min(1160px, 100% - 64px);
  margin-inline: auto;
}

.home-main {
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-cluster {
  position: relative;
  text-align: center;
  width: min(100%, 820px);
}

.home-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.display-heading {
  margin: 0;
  font-family: var(--font-heading);
  font-optical-sizing: auto;
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-title {
  text-wrap: balance;
  font-weight: 800;
}

.home-nav {
  position: relative;
  width: 100%;
  margin-top: 18px;
}

.home-link {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 8px;
  min-height: 34px;
  letter-spacing: 0.01em;
  transition:
    color 150ms ease,
    text-shadow 150ms ease,
    letter-spacing 150ms ease,
    transform 150ms ease;
}

.home-link:hover,
.home-link:focus-visible,
.home-link.is-selected {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(242, 243, 234, 0.24);
  letter-spacing: 0.03em;
  transform: translateY(-1px);
  outline: none;
}

.home-link:focus-visible,
.footer-icons a:focus-visible,
.inline-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.page-main {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-top: 72px;
  padding-bottom: 40px;
}

.page-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.page-title {
  margin: 0;
  text-wrap: balance;
  font-weight: 700;
}

.page-subline {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.content-paragraph {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
  transition: color 150ms ease;
}

.content-paragraph:hover {
  color: var(--text-primary);
}

.project-stack,
.list-stack,
.contact-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-entry {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-line,
.contact-line {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.detail-list {
  margin: 0;
  color: var(--text-secondary);
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.detail-list li {
  min-height: 0;
}

.inline-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(242, 243, 234, 0.45);
  transition:
    color 140ms ease,
    text-decoration-color 140ms ease,
    text-underline-offset 140ms ease;
}

.inline-link:hover {
  color: var(--focus);
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.contact-label {
  min-width: 112px;
}

.site-footer {
  width: min(1160px, 100% - 64px);
  margin-inline: auto;
  padding: 20px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-name {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-icons a {
  color: var(--footer-icon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  transition:
    color 130ms ease,
    transform 130ms ease;
}

.footer-icons svg {
  display: block;
  width: 1em;
  height: 1em;
}

.footer-icons a:hover {
  color: var(--footer-icon-hover);
  transform: translateY(-1px);
}

.has-custom-cursor,
.has-custom-cursor a,
.has-custom-cursor button,
.has-custom-cursor [role="button"] {
  cursor: none;
}

.custom-cursor,
.custom-cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  transform: translate3d(-200px, -200px, 0);
  z-index: 1000;
}

.custom-cursor {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
  image-rendering: pixelated;
}

.custom-cursor-trail {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
.page-main,
.home-main,
.site-footer {
  width: calc(100% - 28px);
}

.home-main {
  padding-top: 8px;
}

.center-cluster {
  padding: 110px 8px;
}

.home-label {
  font-size: 0.78rem;
}

.home-title {
  font-size: clamp(2rem, 12vw, 3.2rem);
  line-height: 1;
  margin-top: 6px;
}

.home-nav {
  height: 174px;
}

.home-link {
  font-size: 0.7rem;
  padding: 3px 6px;
  min-height: 44px;
}

.home-link-about {
  left: 0;
  top: 0;
  transform: translate(0, -4%);
}

.home-link-projects {
  right: 0;
  top: 0;
  transform: translate(0, -4%);
}

.home-link-hobbies {
  left: 0;
  bottom: 0;
  transform: translate(0, 4%);
}

.home-link-photos {
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 4%);
}

.home-link-blog {
  left: 50%;
  top: 0;
  transform: translate(-50%, -4%);
}

.home-link-contact {
  right: 0;
  bottom: 0;
  transform: translate(0, 4%);
}

.page-main {
  padding-top: 36px;
  gap: 18px;
}

.page-label {
  font-size: 0.8rem;
}

.page-title {
  font-size: clamp(1.68rem, 9vw, 2.55rem);
  line-height: 1.08;
}

.page-subline,
.project-line,
.contact-line {
  font-size: 0.82rem;
}

.content-paragraph {
  line-height: 1.65;
}

.contact-label {
  min-width: 80px;
}

.site-footer {
  padding: 12px 0 16px;
  align-items: center;
}

.footer-name {
  font-size: 0.78rem;
  line-height: 1;
}

.footer-icons {
  gap: 11px;
}

.footer-icons a {
  font-size: 0.95rem;
  min-width: 44px;
  min-height: 44px;
}

/* Targeted layout fixes: stacked mobile nav, centered inner pages, fixed inner footer. */
.home-main {
  padding-top: 0;
}

.center-cluster {
  width: min(100%, 560px);
  min-height: min(72svh, 560px);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-label {
  margin-bottom: 6px;
}

.home-title {
  margin-top: 0;
}

body[data-page="home"] .home-nav {
  position: static;
  inset: auto;
  width: min(100%, 360px);
  height: auto;
  margin-top: clamp(12px, 2.6vh, 22px);
  transform: translateY(var(--home-links-shift-y));
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
  pointer-events: auto;
}

body[data-page="home"] .home-link {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  text-wrap: balance;
  text-align: center;
  padding: 8px 10px;
  min-height: 40px;
  font-size: 0.76rem;
  line-height: 1.15;
}

body:not([data-page="home"]) .page-main {
  min-height: 100svh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 0;
}

body:not([data-page="home"]) .page-main > * {
  width: min(760px, calc(100vw - 48px));
  max-width: 760px;
}

body:not([data-page="home"]) .content-stack,
body:not([data-page="home"]) .project-stack,
body:not([data-page="home"]) .list-stack,
body:not([data-page="home"]) .contact-stack {
  max-width: none;
}

body[data-page="home"] .site-footer,
body:not([data-page="home"]) .site-footer {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: auto;
  margin: 0;
  padding: 0;
  z-index: 40;
}
