@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/raleway-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-bg: rgb(248, 245, 242);
  --color-heading: rgb(120, 117, 114);
  --color-body: rgb(95, 92, 89);
  --color-link: rgb(75, 72, 69);
  --color-link-hover: rgb(90, 87, 84);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: rgb(30, 28, 26);
    --color-heading: rgb(248, 245, 242);
    --color-body: rgb(185, 182, 179);
    --color-link: rgb(163, 160, 157);
    --color-link-hover: rgb(208, 205, 202);
  }
}

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

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg);
  font-family: 'Raleway', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-tree {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  max-width: 800px;
  max-height: 800px;
  background: url('/assets/images/tree.svg') center / contain no-repeat;
  opacity: 0.02;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

@media (prefers-color-scheme: dark) {
  .bg-tree {
    opacity: 0.02;
    filter: invert(1);
  }
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: clamp(3rem, 22vw, 5rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--color-heading);
  margin: 0 0 2.5rem;
}

a {
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

a:hover,
a:focus {
  color: var(--color-link-hover);
  border-bottom-color: var(--color-link-hover);
}

.icons {
  padding: 2rem 2rem calc(2rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.icons a {
  color: var(--color-link);
  border-bottom: none;
  padding-bottom: 0;
  display: inline-flex;
}

.icons a:hover,
.icons a:focus {
  color: var(--color-link-hover);
  border-bottom: none;
}

/* ── Homepage page nav ──────────────────────────────────────── */

.page-nav {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
}

.page-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Site header (content pages) ───────────────────────────── */

.site-header {
  width: 100%;
  padding: 1.75rem 2rem 0;
  position: relative;
  z-index: 1;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.breadcrumb span {
  color: var(--color-body);
  font-size: 0.875rem;
  opacity: 0.5;
}

.site-header a {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  font-weight: 400;
  text-transform: uppercase;
}

/* ── Page layout (non-centered, for content pages) ─────────── */

.page-main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  position: relative;
  z-index: 1;
  text-align: left;
}

.page-title {
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--color-heading);
  margin: 0 0 3rem;
}

/* ── Page intro ─────────────────────────────────────────────── */

.page-intro {
  margin: -1.5rem 0 1.5rem;
}

/* ── Projects list ──────────────────────────────────────────── */

.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project {
  border-top: 1px solid color-mix(in srgb, var(--color-body) 20%, transparent);
  padding-top: 2rem;
}

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.project-name {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--color-heading);
  margin: 0;
}

/* ── Prose (about page body text) ──────────────────────────── */

.prose {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 300;
}

.prose a {
  border-bottom-color: currentColor;
}

.prose p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-body);
  margin: 0 0 1.25rem;
  max-width: 56ch;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ── Prose images ───────────────────────────────────────────── */

.prose img {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 480px;
  border: 1px solid color-mix(in srgb, var(--color-body) 25%, transparent);
  border-radius: 4px;
  margin: 1.5rem auto;
}

/* ── Project page ───────────────────────────────────────────── */

.project-page-header .page-title {
  margin-bottom: 0.5rem;
}

.project-page-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-page-meta .project-date {
  margin-left: 0;
}

.project-ingress {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--color-body);
  margin: 1.75rem 0;
  max-width: 52ch;
}

.project-page-links {
  margin-top: 0.25rem;
}

/* ── Project date ───────────────────────────────────────────── */

.project-name a {
  color: var(--color-heading);
}

.project-name a::after {
  content: " →";
  font-size: 0.85em;
}

.project-date {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-body);
  margin-left: 0.6em;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.project-description {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 300;
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--color-body);
}

/* ── View transitions ───────────────────────────────────────── */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: dissolve-out 0.3s ease-in forwards;
}

::view-transition-new(root) {
  animation: dissolve-in 0.3s ease-out forwards;
}

@keyframes dissolve-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes dissolve-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
