:root {
  --bg: #050608;
  --text: #f2f4f8;
  --muted: #aeb6c3;
  --line: #1e2229;
  --chip: #12151a;
}

:root[data-theme="light"] {
  --bg: #f7f8fb;
  --text: #111317;
  --muted: #4e5563;
  --line: #d8dde6;
  --chip: #eceff4;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

.container {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 72px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 4.2vw, 48px);
  letter-spacing: 0.01em;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 50px);
}

p {
  max-width: 760px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: clamp(17px, 1.8vw, 23px);
}

.meta {
  margin-top: 96px;
}

.meta p {
  margin: 0;
  font-size: clamp(13px, 1.3vw, 16px);
}

.location {
  color: var(--text);
}

.quick-links {
  margin-top: 24px;
  display: flex;
  gap: 28px;
}

.quick-links a,
.social-list a,
.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(16px, 1.5vw, 22px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quick-links a:hover,
.social-list a:hover,
.back-link:hover {
  color: var(--text);
}

.subtitle {
  margin-bottom: 34px;
}

.essay-list article {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.essay-list article:last-child {
  border-bottom: 1px solid var(--line);
}

.essay-list h2 {
  margin-bottom: 8px;
}

.essay-list p {
  margin: 0;
  font-size: clamp(15px, 1.8vw, 20px);
  text-transform: lowercase;
}

.social-list {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.home-socials {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 20px;
  max-width: 1000px;
}

.home-socials a {
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(16px, 1.45vw, 21px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.home-socials a:hover {
  color: var(--text);
}

.social-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-chip {
  width: 22px;
  height: 22px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  color: var(--muted);
}

.theme-toggle {
  position: fixed;
  top: 8px;
  right: 8px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scramble.scrambling {
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.moon-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
  display: inline-block;
}

.moon-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--chip);
  top: -2px;
  left: 5px;
}

.theme-menu {
  position: fixed;
  top: 62px;
  right: 8px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  width: 130px;
}

.theme-menu button {
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.theme-menu button:hover {
  background: rgba(127, 127, 127, 0.2);
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .container {
    padding-top: 56px;
    padding-bottom: 22px;
  }

  h1 {
    font-size: clamp(30px, 9vw, 38px);
  }

  p {
    font-size: clamp(14px, 3.9vw, 17px);
    margin-bottom: 12px;
  }

  .meta {
    margin-top: 32px;
  }

  .quick-links {
    margin-top: 14px;
  }

  .quick-links a,
  .social-list a,
  .back-link {
    font-size: clamp(15px, 4vw, 18px);
  }

  .home-socials {
    margin-top: 16px;
    gap: 12px 14px;
  }

  .home-socials a {
    font-size: clamp(14px, 3.8vw, 17px);
  }

  .theme-menu button {
    font-size: 15px;
  }
}
