:root {
  --bg: #343a40;
  --text: #f4e3c8;
  --muted: #d7c6aa;
  --line: #7f7465;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.home-layout {
  --orbit-size: min(115vmin, 1216px);
  --label-offset: min(28vmin, 300px);
  --words-shift: 64px;
  --handle-shift: -64px;
  --label-font: clamp(38px, 4.2vw, 56px);
  height: 100%;
  padding: 0 8px 8px;
  position: relative;
  isolation: isolate;
}

.hero-geometry {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-axis,
.hero-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
}

.hero-axis {
  background: rgba(244, 227, 200, 0.105);
}

.hero-axis-x {
  width: 100%;
  height: 1px;
  transform: translate(-50%, -50%);
}

.hero-axis-y {
  width: 1px;
  height: 100%;
  transform: translate(-50%, -50%);
}

.hero-orbit {
  width: var(--orbit-size);
  height: var(--orbit-size);
  transform: translate(-50%, -50%);
  overflow: visible;
}

.hero-orbit-outline {
  fill: none;
  stroke: rgba(244, 227, 200, 0.22);
  stroke-width: 3.5;
  vector-effect: non-scaling-stroke;
}

.cross-block {
  position: absolute;
  left: calc(50% + var(--label-offset) + var(--handle-shift));
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1;
}

.handle {
  font-size: var(--label-font);
  font-weight: 600;
  line-height: 1;
}

.nav-block {
  position: absolute;
  left: calc(50% - var(--label-offset) + var(--words-shift));
  top: 50%;
  transform: translate(-50%, -0.5em);
  text-align: center;
  font-size: var(--label-font);
  line-height: 1;
  font-weight: 600;
  width: max-content;
  z-index: 1;
}

.nav-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(16px, 2vw, 30px);
}

.nav-line-small {
  position: absolute;
  left: 50%;
  top: calc(1em + 18px);
  width: max-content;
  margin-top: 0;
  font-size: 0.5em;
  transform: translateX(-50%);
  transition: color 420ms ease, filter 420ms ease, text-shadow 520ms ease;
}
.nav-line-small.contact-spotlight {
  color: #ffb45c;
  text-shadow: 0 0 22px rgba(255, 136, 36, 0.64), 0 0 42px rgba(255, 116, 20, 0.32);
  filter: brightness(1.18) saturate(1.18);
  animation: contact-spotlight-pulse 1900ms cubic-bezier(0.16, 1, 0.3, 1) 1;
}
@keyframes contact-spotlight-pulse {
  0% {
    text-shadow: 0 0 0 rgba(255, 136, 36, 0);
  }

  22% {
    text-shadow: 0 0 28px rgba(255, 136, 36, 0.82), 0 0 58px rgba(255, 104, 16, 0.42);
  }

  68% {
    text-shadow: 0 0 14px rgba(255, 136, 36, 0.3), 0 0 30px rgba(255, 104, 16, 0.14);
  }

  100% {
    text-shadow: 0 0 0 rgba(255, 136, 36, 0);
  }
}



.copyable {
  cursor: pointer;
}


.contact-panel {
  position: absolute;
  left: 50%;
  top: clamp(28px, 8vh, 72px);
  z-index: 2;
  width: min(760px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.contact-panel[hidden] {
  display: none;
}

.contact-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 42px);
  color: var(--text);
  pointer-events: auto;
}

.contact-line {
  appearance: none;
  min-width: 10ch;
  max-width: min(34ch, 42vw);
  border: 0;
  border-bottom: 1px solid rgba(244, 227, 200, 0.26);
  border-radius: 0;
  padding: 0 0 4px;
  background: transparent;
  color: var(--text);
  font: 600 16px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: center;
}

.contact-message-line {
  width: min(34ch, 42vw);
  min-height: calc(1em + 4px);
  overflow: hidden;
  resize: none;
  text-align: left;
  white-space: pre-wrap;
}

.contact-timestamp {
  display: none;
}

.contact-line[hidden] {
  display: none;
}

.contact-line::placeholder {
  color: rgba(244, 227, 200, 0.46);
  opacity: 1;
}

.contact-line:focus,
.copyable:focus-visible {
  outline: 0;
}

.contact-line:focus {
  border-bottom-color: rgba(244, 227, 200, 0.64);
}

.contact-status {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(244, 227, 200, 0.72);
}

.contact-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.copy-status {
  position: absolute;
  left: 50%;
  top: calc(2em + 34px);
  width: max-content;
  margin-top: 0;
  font-size: 14px;
  opacity: 0.86;
  min-height: 1.2em;
  transform: translateX(-50%);
}

.copy-status,
.contact-status {
  opacity: 0;
  transition: opacity 420ms ease;
}

.copy-status.status-visible,
.contact-status.status-visible {
  opacity: 0.86;
}

@media (prefers-reduced-motion: reduce) {
  .copy-status,
  .contact-status {
    transition: none;
  }

  .nav-line-small.contact-spotlight {
    animation: none;
    text-shadow: 0 0 0 rgba(255, 136, 36, 0);
    color: #ffb45c;
  }
}

.words-page {
  --words-pad: clamp(26px, 3vw, 42px);
  --words-gap: clamp(20px, 4vw, 56px);
  background: #30353b;
  display: grid;
  grid-template-columns: minmax(220px, calc(50vw - var(--words-pad))) minmax(0, 1fr);
  gap: var(--words-gap);
  align-items: stretch;
  height: 100%;
  padding: var(--words-pad);
}

.words-hero {
  align-self: start;
  margin-top: 6vh;
}

.words-contact-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(244, 227, 200, 0.34);
  text-decoration-thickness: from-font;
  text-underline-offset: 0.12em;
  transition: color 180ms ease, text-decoration-color 180ms ease, text-shadow 180ms ease;
}

.words-contact-link:hover,
.words-contact-link:focus-visible {
  color: var(--text);
  text-decoration-color: rgba(244, 227, 200, 0.72);
  text-shadow: 0 0 0.01px currentColor;
  outline: 0;
}

.words-title {
  font-size: clamp(52px, 6vw, 88px);
  font-weight: 600;
  margin: 0;
}

.words-subtitle {
  max-width: calc(50vw - var(--words-pad));
  margin: 0.42em 0 0;
  color: rgba(215, 198, 170, 0.74);
  font-size: clamp(21px, 2.4vw, 35px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

.words-home-link,
.words-github-link {
  position: absolute;
  right: var(--words-pad);
  z-index: 2;
  color: rgba(215, 198, 170, 0.74);
}

.words-home-link {
  top: var(--words-pad);
  width: clamp(46px, 5.4vw, 78px);
  font-size: clamp(52px, 6vw, 88px);
  font-weight: 300;
  line-height: 1;
  text-align: center;
}

.words-github-link {
  top: calc(var(--words-pad) + clamp(52px, 6vw, 88px) + 12px);
  width: clamp(46px, 5.4vw, 78px);
  height: clamp(46px, 5.4vw, 78px);
  display: block;
}

.words-github-link svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.words-home-link:hover,
.words-home-link:focus-visible,
.words-github-link:hover,
.words-github-link:focus-visible {
  color: var(--text);
}

@media (min-width: 961px) {
  .words-hero {
    width: calc(50vw - var(--words-pad));
  }
}

.words-content {
  height: calc(50vh - var(--words-pad));
  min-height: 0;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 0;
}

.list-shell {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: none;
  background: #30353b;
}

.post-list {
  margin: 0;
  padding: 18px 24px;
  list-style: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-color: var(--muted) rgba(0, 0, 0, 0.2);
}

.post-item {
  margin: 0;
  padding: clamp(14px, 2.2vh, 24px) 0;
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1.8vw, 24px);
  font-size: clamp(34px, 4.1vw, 56px);
  line-height: 1.02;
  border-bottom: 1px solid rgba(244, 227, 200, 0.09);
}

.post-item-empty {
  font-size: clamp(52px, 6vw, 88px);
  font-weight: 600;
  line-height: normal;
}

.post-item button {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1.8vw, 24px);
  width: 100%;
}

.post-date {
  font-size: clamp(18px, 2vw, 34px);
  color: var(--muted);
}

.post-x {
  font-size: 0.98em;
  line-height: 1;
}

.post-title {
  font-size: 0.82em;
  line-height: 1;
}

.modal {
  position: fixed;
  right: clamp(18px, 4vw, 56px);
  top: clamp(18px, 10vh, 100px);
  width: min(60vw, 680px);
  max-width: calc(100vw - 30px);
  min-width: min(320px, calc(100vw - 30px));
  height: min(58vh, 520px);
  max-height: calc(100vh - 30px);
  min-height: 230px;
  border: 2px solid var(--line);
  background: rgba(35, 40, 46, 0.97);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  resize: both;
  overflow: hidden;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(244, 227, 200, 0.2);
  font-size: 20px;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.close-btn {
  all: unset;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  border: 1px solid rgba(244, 227, 200, 0.45);
  width: 24px;
  height: 24px;
  text-align: center;
}

.modal-body {
  padding: 16px 18px;
  height: calc(100% - 52px);
  overflow: auto;
  line-height: 1.5;
  font-size: clamp(16px, 1.4vw, 22px);
  white-space: normal;
}

.modal-body h1,
.modal-body h2,
.modal-body h3,
.modal-body p,
.modal-body ul,
.modal-body ol,
.modal-body pre,
.modal-body blockquote {
  margin: 0 0 0.85em;
}

.modal-body pre {
  overflow-x: auto;
  padding: 0.75em;
  border: 1px solid rgba(244, 227, 200, 0.18);
  background: rgba(0, 0, 0, 0.18);
  white-space: pre;
}

.modal-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.modal-body blockquote {
  padding-left: 0.85em;
  border-left: 2px solid rgba(244, 227, 200, 0.28);
  color: var(--muted);
}

.works-page {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
}

.works-title {
  font-size: clamp(54px, 7vw, 100px);
  margin: 0;
}

.works-copy {
  margin: 10px 0 0;
  font-size: clamp(16px, 2vw, 28px);
  color: var(--muted);
}


@media (max-width: 960px) {
  .home-layout {
    --orbit-size: min(138vw, 832px);
    --label-offset: clamp(104px, 28vw, 190px);
    --words-shift: 54px;
    --handle-shift: -54px;
  }




  .contact-panel {
    top: clamp(24px, 7vh, 54px);
  }

  .contact-form {
    flex-direction: column;
    gap: 12px;
  }

  .contact-message-line {
    width: calc(100vw - 40px);
  }

  .contact-line {
    max-width: calc(100vw - 40px);
  }
  .words-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 16px;
  }

  .words-hero {
    margin-top: 0;
  }

  .words-title {
    font-size: clamp(38px, 9vw, 64px);
  }

  .words-home-link {
    font-size: clamp(38px, 9vw, 64px);
    width: clamp(34px, 8vw, 56px);
  }

  .words-github-link {
    top: calc(var(--words-pad) + clamp(38px, 9vw, 64px) + 10px);
    width: clamp(34px, 8vw, 56px);
    height: clamp(34px, 8vw, 56px);
  }

  .words-content {
    padding-top: 0;
  }

  .post-item {
    font-size: clamp(30px, 8vw, 50px);
  }

  .post-item-empty {
    font-size: clamp(38px, 9vw, 64px);
  }

  .post-date {
    font-size: clamp(16px, 3.8vw, 28px);
  }

  .modal {
    left: 15px;
    right: 15px;
    width: auto;
    min-width: unset;
    top: auto;
    bottom: 15px;
    height: min(45vh, 460px);
  }
}

@media (max-width: 640px) {
  .home-layout {
    --orbit-size: min(86vw, 58vh, 380px);
    --label-font: clamp(30px, 10vw, 42px);
  }

  .nav-block,
  .cross-block {
    left: 50%;
  }

  .nav-block {
    top: calc(50% - (var(--orbit-size) / 2) - clamp(70px, 11vh, 92px));
    transform: translate(-50%, 0);
  }

  .cross-block {
    top: calc(50% + (var(--orbit-size) / 2) + clamp(42px, 7vh, 66px));
    transform: translate(-50%, -50%);
  }

  .contact-panel {
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .nav-line-small {
    top: calc(1em + 16px);
  }
}
