/* =========================================================
   SHARED STYLES — Your Name portfolio
   Edit colors/fonts here once; every page updates.
   ========================================================= */

:root {
  --paper:    #f3efe6;
  --paper-2:  #ece6da;
  --ink:      #1c1a17;
  --ink-soft: #4a463f;
  --muted:    #8c857a;
  --accent:   #bd4b2c;   /* terracotta */
  --accent-2: #2f5d50;   /* deep forest, secondary */
  --line:     #d8d1c4;
  --display:  "Fraunces", Georgia, "Times New Roman", serif;
  --body:     "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* paper grain overlay */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; text-decoration: none; }
.wrap { width: min(1180px, 90vw); margin: 0 auto; }

/* ---------- NAV ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(6px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .4s ease, background .4s ease;
}
nav.scrolled { border-bottom-color: var(--line); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.mark { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; }
.mark span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-size: 0.92rem; color: var(--ink-soft); position: relative; transition: color .25s; }
.nav-links a.active { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--accent); transition: width .3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.status { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--ink-soft); }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

/* ---------- HERO ---------- */
header.hero { padding: 12rem 0 6rem; }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.6rem; }
h1.big {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3.2rem, 11vw, 9rem); line-height: 0.92; letter-spacing: -0.03em;
}
h1.big em { font-style: italic; color: var(--accent); }
.hero-sub { margin-top: 2.2rem; max-width: 36ch; font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--ink-soft); }
.scroll-cue {
  margin-top: 4rem; display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue .arrow { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- PAGE HEADER (blog / projects tops) ---------- */
header.page-head { padding: 11rem 0 3rem; }
header.page-head h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1; letter-spacing: -0.03em;
}
header.page-head h1 em { font-style: italic; color: var(--accent); }
header.page-head p { margin-top: 1.2rem; max-width: 46ch; color: var(--ink-soft); }

/* ---------- SECTION SHARED ---------- */
section { padding: 6rem 0; }
.sec-label {
  font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2.5rem; display: flex; align-items: center; gap: 1rem;
}
.sec-label::before { content: ""; width: 36px; height: 1px; background: var(--accent); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.see-all { font-size: 0.9rem; color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .3s; }
.see-all:hover { border-bottom-color: var(--accent); }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 4rem; align-items: start; }
.portrait {
  aspect-ratio: 4/5; border-radius: 4px; overflow: hidden;
  background: linear-gradient(135deg, var(--paper-2), var(--line));
  position: relative; border: 1px solid var(--line);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait .placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem; letter-spacing: 0.1em; text-align: center; padding: 1rem;
}
.about-text h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 1.6rem;
}
.about-text p { color: var(--ink-soft); margin-bottom: 1.2rem; }
.about-text p strong { color: var(--ink); font-weight: 600; }

/* ---------- LISTS (posts & projects) ---------- */
.entry-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.entry {
  background: var(--paper); padding: 2.2rem 2.5rem; display: grid;
  grid-template-columns: 8rem 1fr auto; gap: 2rem; align-items: center;
  transition: background .35s ease, padding-left .35s ease;
}
.work-bg .entry { background: var(--paper-2); }
.entry:hover { background: var(--ink); padding-left: 3.2rem; }
.entry:hover * { color: var(--paper) !important; }
.entry:hover .entry-meta { color: var(--accent) !important; }
.entry:hover .arrow { transform: translateX(6px) rotate(-45deg); color: var(--accent) !important; }
.entry-meta { font-size: 0.85rem; color: var(--muted); transition: color .35s; }
.entry-body h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.01em; transition: color .35s; }
.entry-body p { font-size: 0.95rem; color: var(--muted); transition: color .35s; margin-top: .3rem; }
.entry .arrow { font-size: 1.4rem; color: var(--muted); transition: transform .35s, color .35s; }
.work-bg { background: var(--paper-2); }

.empty { padding: 3rem; text-align: center; color: var(--muted); background: var(--paper); }

/* ---------- ARTICLE (rendered markdown) ---------- */
.article { padding: 10rem 4rem 6rem; max-width: 780px; margin: 0 auto; }
.article .wrap { width: min(680px, 85vw); }
.back-link { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--accent); margin-bottom: 2.5rem; }
.back-link:hover { gap: .8rem; }
.article-meta { font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.article h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 2.5rem;
}
.prose { font-size: 1.12rem; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.3rem; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; color: var(--ink); margin-top: 2.5rem; letter-spacing: -0.01em; }
.prose h3 { font-family: var(--display); font-weight: 400; font-size: 1.4rem; color: var(--ink); margin-top: 2rem; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--accent); padding-left: 1.4rem; margin-left: 0;
  font-family: var(--display); font-style: italic; font-size: 1.3rem; color: var(--ink);
}
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-top: .5rem; }
.prose img { max-width: 100%; border-radius: 4px; border: 1px solid var(--line); }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em;
  background: var(--paper-2); padding: 0.15em 0.4em; border-radius: 3px;
}
.prose pre { background: var(--ink); color: var(--paper); padding: 1.4rem; border-radius: 6px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- CONTACT ---------- */
.contact { text-align: center; padding: 9rem 0; }
.contact .sec-label { justify-content: center; }
.contact .sec-label::before { display: none; }
.contact h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 5.5rem); line-height: 1; letter-spacing: -0.03em; margin-bottom: 2.5rem;
}
.mailto { font-family: var(--display); font-style: italic; color: var(--accent); border-bottom: 2px solid transparent; transition: border-color .3s; }
.mailto:hover { border-bottom-color: var(--accent); }
.socials { margin-top: 3rem; display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.socials a { font-size: 0.95rem; color: var(--ink-soft); position: relative; transition: color .25s; }
.socials a:hover { color: var(--ink); }
.socials a::after { content: "↗"; margin-left: 0.35rem; font-size: 0.8rem; color: var(--accent); }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--line); padding: 2.5rem 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.85rem; color: var(--muted);
}

/* ---------- ANIMATION ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.load { opacity: 0; transform: translateY(20px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.load.d1 { animation-delay: .1s; } .load.d2 { animation-delay: .25s; }
.load.d3 { animation-delay: .4s; } .load.d4 { animation-delay: .55s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .portrait { max-width: 300px; }
  .entry { grid-template-columns: 1fr; gap: .6rem; padding: 1.8rem; }
  .entry:hover { padding-left: 1.8rem; }
  .entry .arrow { display: none; }
  header.hero { padding: 9rem 0 4rem; }
}

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