/* ==========================
   Inter Variable Font
   ========================== */
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ==========================
   Base
   ========================== */
:root{
  --bg: #f1efe9;
  --border: rgba(0,0,0,0.14);
  --text: rgba(0,0,0,0.94);
  --muted: rgba(0,0,0,0.58);
  --accent: #000000;
}

*{
  box-sizing: border-box;
}

html{
  color-scheme: light;
  scroll-behavior: smooth;
}

body{
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* ==========================
   Layout
   ========================== */
.container{
  width: min(1320px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.5rem 0 6rem;
}

.stack{
  display: flex;
  flex-direction: column;
}

.page-section{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
  border-top: 1px solid rgba(0,0,0,0.16);
  padding: 1.8rem 0;
  scroll-margin-top: 1.25rem;
}

.hero-section{
  grid-template-columns: minmax(0, 1fr) 340px;
}

.section-body{
  max-width: 840px;
}

.section-meta{
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.section-meta{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.meta-number{
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.88);
}

.meta-label{
  display: block;
  font-size: 0.84rem;
  color: rgba(0,0,0,0.5);
}

.meta-number{
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.88);
}

.meta-label{
  margin-top: 0.25rem;
  font-size: 0.84rem;
  color: rgba(0,0,0,0.5);
}

/* ==========================
   Header / Nav
   ========================== */
.site-header{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

nav{
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a{
  position: relative;
  text-decoration: none;
  color: rgba(0,0,0,0.7);
  font-size: 0.96rem;
  font-weight: 500;
  transition: 140ms ease;
}

nav a::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 1px;
  background: rgba(0,0,0,0.75);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}

nav a:hover{
  color: rgba(0,0,0,0.96);
}

nav a:hover::after{
  transform: scaleX(1);
}

/* ==========================
   Hero media
   ========================== */
.hero-media{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  justify-self: end;
}

.portrait-media{
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(1.2) brightness(1.1);
  mix-blend-mode: multiply;
}

.portrait-github{
  display: inline-block;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  color: rgba(0,0,0,0.72);
}

.portrait-github:hover{
  color: #29d17d;
}

/* ==========================
   Typography
   ========================== */
h1,
h2{
  margin: 0 0 1rem;
  font-size: clamp(2.3rem, 4.3vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 600;
}

h3{
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
  line-height: 1.3;
}

p{
  margin: 0 0 1rem;
  max-width: 760px;
  font-size: 1rem;
  color: rgba(0,0,0,0.9);
}

a{
  color: rgba(0,0,0,0.94);
}

a:hover{
  color: rgba(0,0,0,1);
}

.muted{
  color: var(--muted);
}

.separator{
  margin: 0 12px;
}

/* ==========================
   Projects
   ========================== */
.project{
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(0,0,0,0.09);
}

.project:first-of-type{
  padding-top: 0;
  border-top: 0;
}

.section-divider{
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(0,0,0,0.12);
}

/* ==========================
   Toggle content
   ========================== */
.toggle-content{
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.12);
}

.now-toggle{
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.now-toggle:hover{
  color: var(--accent);
}

.now-archive{
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.09);
}

.now-archive-entry{
  margin-top: 0.7rem;
}

.now-archive-entry summary{
  cursor: pointer;
  color: rgba(0,0,0,0.72);
  font-weight: 500;
}

.now-archive-entry summary:hover{
  color: rgba(0,0,0,1);
}

.now-archive-entry p:first-of-type{
  margin-top: 0.8rem;
}

.subheading{
  margin-top: 1.4rem;
}

/* ==========================
   Footer
   ========================== */
.site-footer{
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(0,0,0,0.12);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
}

/* ==========================
   Responsive
   ========================== */
@media (max-width: 980px){
  .page-section,
  .hero-section{
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .section-meta,
  .hero-media{
    justify-content: flex-start;
    justify-self: start;
  }

  .portrait-media{
    max-width: 100%;
  }
}

@media (max-width: 680px){
  .site-header{
    flex-direction: column;
    align-items: flex-end;
  }

  .container{
    width: min(100%, calc(100% - 1.3rem));
    padding: 1rem 0 5.5rem;
  }

  h1,
  h2{
    font-size: 2rem;
    line-height: 1;
  }
}

@media (prefers-reduced-motion: reduce){
  html{
    scroll-behavior: auto;
  }
}