@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Inter:wght@200;300;400;500;600&display=swap");

:root {
  --black: #000000;
  --near-black: #080808;
  --white: #f2f2ed;
  --muted: rgba(242, 242, 237, 0.52);
  --faint: rgba(242, 242, 237, 0.22);
  --line: rgba(242, 242, 237, 0.13);
  --line-soft: rgba(242, 242, 237, 0.07);
  --accent: #d8ff4f;

  --sans: "Inter", Helvetica, Arial, sans-serif;
  --mono: "DM Mono", monospace;

  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  transition:
    background 400ms ease,
    color 400ms ease;
}

body.light-mode {
  --black: #f0f0eb;
  --near-black: #e8e8e3;
  --white: #080808;
  --muted: rgba(8, 8, 8, 0.55);
  --faint: rgba(8, 8, 8, 0.25);
  --line: rgba(8, 8, 8, 0.15);
  --line-soft: rgba(8, 8, 8, 0.08);
  --accent: #394d00;
}

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

button {
  color: inherit;
  font: inherit;
}

::selection {
  background: var(--accent);
  color: var(--black);
}

/* Background */

.ambient-background {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/7/76/1k_filmgrain.png");
  mix-blend-mode: screen;
}

.ambient-blob {
  position: absolute;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.12;
}

.blob-one {
  top: -25%;
  left: -15%;
  background: #202052;
}

.blob-two {
  right: -20%;
  bottom: -25%;
  background: #173b2d;
  opacity: 0.08;
}

/* Global layout */

.site-shell,
.article-shell {
  position: relative;
  width: min(100% - 48px, var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: relative;
  z-index: 10;
  width: min(100% - 48px, var(--max-width));
  margin: 0 auto;
  padding: 25px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.site-mark,
.site-navigation,
.theme-toggle,
.system-label,
.meta-stack,
.section-index,
.writing-id,
.writing-type,
.tag-list,
.writing-action,
.project-card-top,
.project-label,
.project-card-bottom,
.footer-label,
.footer-status,
.article-navigation,
.article-details,
.article-end {
  font-family: var(--mono);
  text-transform: uppercase;
}

.site-mark {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
}

.site-navigation {
  display: flex;
  gap: 28px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.site-navigation a,
.footer-links a {
  transition: color 180ms ease;
}

.site-navigation a:hover,
.footer-links a:hover,
.article-navigation a:hover,
.article-end a:hover {
  color: var(--accent);
}

.theme-toggle {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 8px;
  letter-spacing: 0.22em;
}

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

/* Hero */

.hero {
  position: relative;
  min-height: 680px;
  padding: 145px 0 100px;
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 8vw;
  align-items: end;
}

.hero-identity h1 {
  margin: 28px 0 0;
  font-size: clamp(3.8rem, 9vw, 8.5rem);
  font-weight: 200;
  letter-spacing: -0.075em;
  line-height: 0.82;
}

.system-label {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.28em;
}

.hero-description {
  max-width: 380px;
  padding-bottom: 4px;
}

.meta-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.16em;
  line-height: 1.4;
}

.hero-description > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.hero-line {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--line);
  transform-origin: left;
  animation: reveal-line 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Sections */

.archive-section,
.about-section {
  padding: 120px 0;
  border-bottom: 1px solid var(--line);
}

.section-index {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 60px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.28em;
}

.index-line {
  height: 1px;
  flex: 1;
  background: var(--line);
}

/* Writing */

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

.writing-row {
  position: relative;
  display: grid;
  grid-template-columns: 13% 1fr 90px;
  gap: 30px;
  padding: 42px 0 48px;
  border-bottom: 1px solid var(--line);
  transition:
    padding 350ms ease,
    background 350ms ease;
}

.writing-row:first-child {
  border-top: 1px solid var(--line);
}

.writing-row:hover {
  padding-right: 18px;
  padding-left: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.writing-id {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.writing-id span:last-child {
  color: var(--faint);
}

.writing-info {
  max-width: 720px;
}

.writing-type {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.writing-info h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4.5vw, 4.8rem);
  font-weight: 200;
  letter-spacing: -0.065em;
  line-height: 0.9;
  transition: color 250ms ease;
}

.writing-row:hover h2 {
  color: var(--accent);
}

.writing-description {
  max-width: 530px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 28px;
}

.tag-list span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.16em;
}

.writing-action {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.arrow {
  font-size: 17px;
  line-height: 0.7;
  transition: transform 250ms ease;
}

.writing-row:hover .arrow {
  transform: translate(4px, -4px);
  color: var(--accent);
}

/* Projects */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.project-card {
  min-height: 420px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  transition:
    background 300ms ease,
    color 300ms ease;
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.055);
}

.project-card-top,
.project-card-bottom {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.project-label {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.project-card h2 {
  max-width: 540px;
  margin: 0 0 22px;
  font-size: clamp(2.3rem, 5vw, 5rem);
  font-weight: 200;
  letter-spacing: -0.07em;
  line-height: 0.86;
}

.project-card p:not(.project-label) {
  max-width: 400px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.project-card-bottom {
  color: var(--accent);
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8vw;
}

.about-heading h2 {
  max-width: 500px;
  margin: 32px 0 0;
  font-size: clamp(3rem, 6vw, 6.5rem);
  font-weight: 200;
  letter-spacing: -0.075em;
  line-height: 0.87;
}

.about-copy {
  max-width: 600px;
}

.about-copy p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.035em;
}

/* Footer */

.site-footer {
  position: relative;
  min-height: 210px;
  padding: 36px 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 25px;
}

.footer-label,
.footer-status {
  display: block;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.footer-status {
  margin-top: 12px;
  color: var(--faint);
}

.footer-links {
  display: flex;
  gap: 22px;
  justify-content: center;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.footer-word {
  justify-self: end;
  color: var(--faint);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 200;
  letter-spacing: -0.1em;
  line-height: 0.65;
  user-select: none;
}

/* Article */

.article-shell {
  padding: 70px 0 130px;
}

.article-navigation {
  display: flex;
  justify-content: space-between;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.article-header {
  padding: 110px 0 115px;
}

.article-header h1 {
  max-width: 1000px;
  margin: 28px 0 34px;
  font-size: clamp(4rem, 10vw, 10rem);
  font-weight: 200;
  letter-spacing: -0.09em;
  line-height: 0.8;
}

.article-lead {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.article-details {
  max-width: 760px;
  margin-top: 65px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-details div {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.article-details span,
.article-details strong {
  display: block;
  font-size: 8px;
  letter-spacing: 0.17em;
}

.article-details span {
  margin-bottom: 12px;
  color: var(--muted);
}

.article-details strong {
  font-weight: 400;
}

.article-content {
  max-width: 680px;
  margin-left: 25%;
}

.article-content p {
  margin: 0 0 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.65;
}

.article-content blockquote {
  margin: 80px 0;
  padding: 4px 0 4px 25px;
  border-left: 1px solid var(--accent);
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1.2;
}

.article-end {
  max-width: 680px;
  margin: 110px 0 0 25%;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.17em;
}

/* Animations */

.reveal {
  animation: reveal-up 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-description {
  animation-delay: 150ms;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-line {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* Responsive */

@media (max-width: 760px) {
  .site-shell,
  .article-shell,
  .site-header {
    width: min(100% - 32px, var(--max-width));
  }

  .site-header {
    gap: 18px;
  }

  .site-navigation {
    gap: 12px;
    font-size: 8px;
  }

  .theme-toggle {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 110px 0 90px;
    display: block;
  }

  .hero-identity h1 {
    font-size: clamp(3.7rem, 17vw, 7rem);
  }

  .hero-description {
    margin-top: 70px;
  }

  .archive-section,
  .about-section {
    padding: 85px 0;
  }

  .section-index {
    margin-bottom: 40px;
  }

  .writing-row {
    grid-template-columns: 1fr 55px;
    gap: 18px;
    padding: 32px 0 38px;
  }

  .writing-row:hover {
    padding-right: 0;
    padding-left: 0;
  }

  .writing-id {
    grid-column: 1 / -1;
    flex-direction: row;
    min-height: auto;
    padding-bottom: 3px;
  }

  .writing-info {
    grid-column: 1;
  }

  .writing-action {
    grid-column: 2;
    grid-row: 2;
  }

  .writing-info h2 {
    font-size: 2.5rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 340px;
  }

  .about-grid {
    display: block;
  }

  .about-heading h2 {
    margin-bottom: 60px;
  }

  .site-footer {
    min-height: 260px;
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-word {
    justify-self: start;
  }

  .article-shell {
    padding-top: 45px;
  }

  .article-navigation {
    gap: 25px;
    line-height: 1.5;
  }

  .article-header {
    padding: 85px 0 80px;
  }

  .article-header h1 {
    font-size: clamp(4rem, 18vw, 8rem);
  }

  .article-lead {
    font-size: 15px;
  }

  .article-details {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 50px;
  }

  .article-content {
    margin-left: 0;
  }

  .article-content p {
    font-size: 19px;
  }

  .article-content blockquote {
    margin: 60px 0;
    font-size: 27px;
  }

  .article-end {
    margin-left: 0;
    gap: 20px;
    line-height: 1.5;
  }

  .article-footer {
    width: min(100% - 32px, var(--max-width));
  }
}
