*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cream: #dbdbdb;
  --peach: #EDC6B2;
  --sky: #B2DEEE;
  --teal: #3C606E;
  --olive: #6E5D3C;
  --sienna: #6E4D3C;
  --base: #1c1c1c;
  --card: #232323;
  --serif: 'EB Garamond', 'Georgia', serif;
  --mono: 'IBM Plex Mono', 'SF Mono', monospace;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
}
html::-webkit-scrollbar { display: none; }

body {
  background: var(--base);
  color: var(--cream);
}

::selection {
  background: rgba(178, 222, 238, 0.2);
  color: #dbdbdb;
}

/* ── Background layer ── */
#bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #1c1c1c;
  z-index: 0;
  pointer-events: none;
}

/* ── Scroll runway ── */
#scroll-runway {
  height: 200vh;
}

/* ── ASCII wrapper (sticky container) ── */
#ascii-wrapper {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ── ASCII canvas ── */
#ascii-canvas {
  display: block;
  pointer-events: none;
}

/* ── ASCII line (under figure) ── */
#ascii-line {
  width: calc(min(660px, 100vw) - 48px);
  height: 2px;
  background: #dbdbdb;
  margin-top: 32px;
  pointer-events: none;
  flex-shrink: 0;
}

/* ── Content layer ── */
#content {
  position: relative;
  z-index: 2;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  position: relative;
}

.hero-inner {
  max-width: 540px;
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(42px, 9vw, 76px);
  font-weight: 400;
  color: #dbdbdb;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2.5px;
  color: rgba(219, 219, 219, 0.45);
  margin-bottom: 36px;
  text-transform: uppercase;
}

.hero-bio {
  font-family: var(--serif);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.85;
  color: rgba(219, 219, 219, 0.88);
  font-weight: 400;
  margin-bottom: 14px;
}

.hero-cta {
  font-family: var(--serif);
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.85;
  color: rgba(219, 219, 219, 0.55);
  font-weight: 400;
  margin-bottom: 14px;
}

/* ── Hero links ── */
.hero-links {
  width: 100%;
  max-width: 380px;
}

/* ── Link rows ── */
.link-row {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px 0;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: rgba(219, 219, 219, 0.55);
  transition: color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}
.link-row:hover {
  color: var(--sky);
}
.link-row strong {
  color: var(--cream);
  font-weight: 500;
  transition: color 0.15s ease;
}
.link-row:hover strong {
  color: var(--sky);
}

/* ── Projects ── */
.projects {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.projects-heading {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  color: var(--cream);
  letter-spacing: -1px;
  text-align: center;
  margin-bottom: 48px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* ── Project card ── */
.project-card {
  background: var(--card);
  border: 1px solid rgba(219, 219, 219, 0.07);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
  overflow: hidden;
}
.project-card:hover {
  border-color: rgba(178, 222, 238, 0.16);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 8px;
}

.project-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.2px;
}

.project-source {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: rgba(219, 219, 219, 0.22);
  flex-shrink: 0;
  white-space: nowrap;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(219, 219, 219, 0.04);
  border: 1px solid rgba(219, 219, 219, 0.06);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-image-placeholder {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(219, 219, 219, 0.15);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-desc {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
  color: rgba(219, 219, 219, 0.38);
  margin-bottom: auto;
}

.project-bottom {
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: var(--teal);
  background: rgba(60, 96, 110, 0.08);
  border: 1px solid rgba(60, 96, 110, 0.15);
  padding: 2px 7px;
}

.project-links {
  display: flex;
  gap: 14px;
}

.project-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: rgba(219, 219, 219, 0.3);
  text-decoration: none;
  transition: color 0.15s ease;
}
.project-link:hover {
  color: var(--sky);
}

/* ── Footer ── */
.site-footer {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.footer-line {
  height: 2px;
  background: #dbdbdb;
  margin-bottom: 20px;
}

.footer-text {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: rgba(219, 219, 219, 0.35);
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: color 0.15s ease;
}
.footer-text:hover {
  color: var(--sky);
}

/* ── Toast ── */
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, 20px); }
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--cream);
  background: #282828;
  border: 1px solid rgba(178, 222, 238, 0.15);
  padding: 10px 28px;
  z-index: 9999;
  pointer-events: none;
}
.toast.show {
  animation: toastIn 0.25s ease forwards;
}
.toast.leaving {
  animation: toastOut 0.25s ease forwards;
}

/* ── Fade-in ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in    { animation: fadeUp 0.9s ease both; }
.fade-in-d1 { animation: fadeUp 0.9s ease 0.15s both; }
.fade-in-d2 { animation: fadeUp 0.9s ease 0.3s both; }
