:root {
  --bg: #070910;
  --bg-soft: #0b0d16;
  --text: #f0eee8;
  --muted: #a8a9b5;
  --muted-strong: #c7c6cc;
  --line: rgba(165, 157, 255, .22);
  --card: rgba(255, 255, 255, .012);
  --accent: #9189ff;
  --accent-bright: #b5afff;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, sans-serif;
  --mono: "DM Mono", monospace;
}

[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-soft: #efeae1;
  --text: #171b24;
  --muted: #5d6476;
  --muted-strong: #384152;
  --line: rgba(91, 99, 140, .16);
  --card: rgba(255, 255, 255, .7);
  --accent: #403ec7;
  --accent-bright: #2d2a8d;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 8%, rgba(104, 91, 255, .09), transparent 28rem),
    radial-gradient(circle at 20% 60%, rgba(72, 65, 180, .05), transparent 35rem),
    var(--bg);
  font-family: var(--sans);
  overflow-x: hidden;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at 78% 8%, rgba(104, 91, 255, .12), transparent 28rem),
    radial-gradient(circle at 20% 60%, rgba(72, 65, 180, .06), transparent 35rem),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 52%, rgba(0,0,0,.28) 100%);
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .035;
  background-image: radial-gradient(rgba(255,255,255,.18) 0.7px, transparent 0.8px);
  background-size: 7px 7px;
  mix-blend-mode: screen;
  /*background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  */
}

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

.site-header {
  width: min(88vw, 1100px);
  margin: 0 auto;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font: 400 21px var(--serif);
}

nav {
  display: flex;
  gap: 36px;
  font: 400 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--muted);
}

nav a {
  position: relative;
  padding: 33px 0 29px;
  transition: color .18s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0.25);
  transform-origin: center;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}

nav a:hover::after,
nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

nav a:hover,
nav a.active {
  color: var(--text);
}

nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(145,137,255,.7);
}

.eyebrow {
  margin: 0 0 25px;
  color: var(--accent-bright);
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .25em;
}

.eyebrow span {
  margin: 0 10px;
  opacity: .85;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
}

h1 {
  margin: 0;
  font-size: clamp(65px, 8vw, 108px);
  line-height: .95;
  letter-spacing: -.055em;
}

.intro {
  max-width: 535px;
  margin: 34px 0 38px;
  color: var(--muted-strong);
  font: 400 17px/1.65 var(--serif);
}

.text-link {
  position: relative;
  display: inline-flex;
  gap: 24px;
  align-items: center;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent-bright);
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .2em;
  transition: gap .25s ease, color .2s ease, transform .2s ease;
}

.text-link::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, rgba(145,137,255,.15), rgba(145,137,255,.9), rgba(145,137,255,.15));
  box-shadow: 0 0 18px rgba(145,137,255,.38);
  opacity: 0;
  transition: opacity .2s ease;
}

.text-link:hover {
  gap: 34px;
  color: var(--text);
  transform: translateX(2px);
}

body[data-theme="light"] .text-link:hover {
  color: var(--accent-bright);
}

.text-link:hover::before {
  opacity: 1;
}

.text-link span {
  font-size: 19px;
  line-height: 0;
}

.contact {
  width: min(88vw, 1100px);
  margin: 0 auto;
  padding: 30px 0 30px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.contact .section-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact .section-intro h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -.02em;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding-top: 10px;
  justify-content: end;
}

.social-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--card);
  transition: border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.social-link::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(145,137,255,.18), transparent 65%);
  opacity: 0;
  transition: opacity .2s ease;
  z-index: -1;
}

.social-link-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.social-link svg,
.social-link img,
.social-link .social-icon {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}

.social-link-small .social-icon,
.social-link-small svg,
.social-link-small img {
  width: 20px;
  height: 20px;
}

.social-icon {
  background-color: currentColor;
  -webkit-mask: var(--social-logo) center / contain no-repeat;
  mask: var(--social-logo) center / contain no-repeat;
  mask-mode: alpha;
}

.social-link:hover {
  color: var(--accent-bright);
  border-color: rgba(145,137,255,.45);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(145,137,255,.08), 0 8px 18px rgba(17,19,35,.22);
}

.social-link:hover::before {
  opacity: 1;
}

.contact-links a {
  color: var(--muted);
}

.contact-links a:hover {
  color: var(--accent-bright);
}

.archive {
  position: relative;
  width: min(88vw, 1100px);
  margin: 0 auto;
  padding: 30px 0 30px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.archive-intro {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  justify-content: end;
}

.archive-mark {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .99;
}

.archive-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(145,137,255,.22));
}

.archive .section-intro {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: right;
  margin-bottom: 0;
  order: 2;
}

.archive .section-intro h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -.02em;
}

.archive-links {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  padding-top: 0;
  margin-top: 0;
  order: 1;
}

.archive-link {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.archive-link::before {
  content: "";
  position: absolute;
  inset: 10px 10px auto 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(145,137,255,.8), transparent);
}

.archive-link::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -75px;
  bottom: -95px;
  border: 1px solid rgba(145,137,255,.2);
  border-radius: 50%;
}

.archive-link:hover {
  border-color: rgba(145,137,255,.45);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(145,137,255,.08), 0 8px 18px rgba(17,19,35,.22);
}

.archive-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 8px;
  border: 1px solid rgba(145,137,255,.35);
  color: var(--accent-bright);
  font: 500 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
}

.archive-year {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: var(--text);
  font: 400 38px var(--serif);
  letter-spacing: -.05em;
  line-height: .92;
}

.archive-meta {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: var(--muted);
  font: 500 10px var(--mono);
  text-transform: lowercase;
  letter-spacing: .12em;
}

footer {
  width: min(88vw, 1100px);
  min-height: 115px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 14px var(--serif);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 27px;
  color: var(--muted);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: .15em;
}

.footer-links a:hover {
  color: var(--accent-bright);
}

.footer-art {
  position: relative;
  height: 145px;
  overflow: hidden;
  opacity: .9;
  background:
    radial-gradient(ellipse 65% 85% at 12% 100%, rgba(115,106,235,.10), transparent 70%),
    radial-gradient(ellipse 65% 90% at 72% 120%, rgba(115,106,235,.09), transparent 70%);
}

.footer-art span {
  position: absolute;
  width: 125%;
  height: 150px;
  left: -12%;
  bottom: -105px;
  border: 1px solid rgba(145,137,255,.16);
  border-radius: 50%;
  transform: rotate(-7deg);
}

.footer-art span:nth-child(2) { bottom: -119px; transform: rotate(-5deg); opacity: .8; }
.footer-art span:nth-child(3) { bottom: -133px; transform: rotate(-3deg); opacity: .6; }
.footer-art span:nth-child(4) { bottom: -147px; transform: rotate(-1deg); opacity: .4; }

.page {
  width: min(88vw, 1100px);
  margin: 0 auto;
  padding: 110px 0 80px;
}

.page h1 {
  margin-bottom: 25px;
  font-size: clamp(48px, 6vw, 72px);
}

.page-back {
  display: inline-flex;
  margin-bottom: 48px;
}

.page-back span {
  transform: scaleX(-1);
}

.page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
}

#input-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5em 0;
  gap: 0.75em;
}

#input-holder label {
  display: flex;
  flex-direction: row;
  align-items: center;
  font: 14px var(--serif);
  color: var(--muted);
}

#input-holder label span {
  padding-right: 0.75em;
}

#view-source {
  margin-top: 1.5em;
  color: var(--accent-bright);
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .15em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  transition: border-color .2s ease;
}

#view-source:hover {
  border-color: var(--accent);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 75px;
}

.project-card {
  min-height: 300px;
  padding: 34px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: .3s ease;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: rgba(165, 157, 255, .5);
  transform: translateY(-4px);
}

.project-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -80px;
  bottom: -90px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.project-card .number {
  color: var(--accent);
  font: 11px var(--mono);
}

.project-card h2 {
  margin: 45px 0 10px;
  font-size: 30px;
}

.project-card p {
  color: var(--muted);
  font: 15px/1.65 var(--serif);
  max-width: 500px;
}

.project-card a {
  position: absolute;
  left: 34px;
  bottom: 32px;
  color: var(--accent-bright);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: .15em;
}

.sketches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 75px;
}

.sketch-card {
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  transition: .3s ease;
  display: flex;
  flex-direction: column;
}

.sketch-card:hover {
  border-color: rgba(165, 157, 255, .5);
  transform: translateY(-4px);
}

.sketch-card .card-img {
  aspect-ratio: 4 / 3;
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.sketch-card p {
  margin: 0;
  padding: 18px 20px;
  color: var(--text);
  font: 400 18px var(--serif);
  text-align: center;
}

::selection {
  background: rgba(145,137,255,.28);
  color: var(--text);
}

footer {
  animation: appear .7s ease both;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slowPulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: .85; transform: scale(1.04); }
}

.hero-mark::before {
  content: "";
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(145,137,255,.18), rgba(145,137,255,.06) 30%, transparent 70%);
  filter: blur(28px);
  animation: slowPulse 7s ease-in-out infinite;
}

@media (max-width: 800px) {
  .site-header { height: 72px; }
  nav { gap: 15px; font-size: 9px; }
  nav a { padding: 27px 0 25px; }

  .contact {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .archive {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
  }

  .archive .section-intro {
    width: 100%;
    align-items: center;
    text-align: center;
    order: 1;
  }

  .archive-intro {
    justify-content: center;
  }

  .archive-mark {
    width: 16px;
    height: 16px;
  }

  .archive-links {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    order: 2;
  }

  .archive-link {
    width: min(100%, 240px);
  }

  .contact-links {
    justify-content: center;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 25px;
  }

  .footer-art { height: 110px; }
}

@media (max-width: 520px) {
  .site-header,
  footer {
    width: 88vw;
  }

  .contact,
  .archive {
    width: 88vw;
  }

  .contact .section-intro h2,
  .archive .section-intro h2 {
    font-size: 36px;
  }

  .wordmark { font-size: 18px; }
  nav a:nth-child(3),
  nav a:nth-child(4) { display: none; }
  .intro { font-size: 16px; }
  .footer-links { flex-wrap: wrap; }
}

@media (max-width: 650px) {
  .project-grid { grid-template-columns: 1fr; }
  .page { padding-top: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
