/* ---------- tokens ---------- */
* { box-sizing: border-box; }

:root {
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 20px;
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  --bg: #F2F2EF;
  --text: #15160f;
  --text-secondary: #63655e;
  --text-muted: #8a8c84;
  --link: #183E0C;
  --link-hover: #378C1B;
  --hover: #378C1B;
  --border: #d4d4cc;
  --card-bg: #e4e4dd;

  color: var(--text);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: clip;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(59, 74, 67, 0.3);
  background: linear-gradient(to right, var(--link-hover), var(--link-hover)) no-repeat;
  background-size: 0% 1px;
  background-position: left calc(100% + 1px);
  transition: background-size 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}

a:hover {
  color: var(--link-hover);
  background-size: 100% 1px;
  border-bottom-color: transparent;
}

a:focus-visible { 
  outline: 2px solid var(--link); 
  outline-offset: 3px; 
  border-radius: 2px; 
}

/* ---------- shell ---------- */
.app-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 2.25rem;
  padding-left: max(2.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(2.25rem, env(safe-area-inset-right, 0px));
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ---------- bio ---------- */
.home { padding-top: 2.5rem; }

.bio-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.brand-name {
  margin: 0 0 1.25rem;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  min-height: 2.6rem;
}

.typing-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--link);
  font-weight: 400;
  transform: translateY(-0.05em);
}

.typing-cursor-blink { animation: typing-blink 1s steps(2, start) infinite; }

@keyframes typing-blink { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .typing-cursor-blink { animation: none; }
}

.bio-text p {
  margin: 0 0 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

.portrait-frame {
  display: block;
  width: 260px;
  height: 260px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--text);
  box-shadow: 11px 11px 0 rgba(59, 74, 67, 0.13);
}

.bio-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 1.75rem !important;
}

.contact-row .sep { color: var(--text-muted); }

/* ---------- sections ---------- */
.section { margin-top: 3rem; }

.section-heading {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.section-blurb {
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ---------- entries ---------- */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-top: 0.75rem;
}

.entry-list-tight { gap: 2rem; }

.entry {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.entry-side { width: 160px; }

.tag {
  padding: 0.5rem 0.75rem;
  border-radius: 2px;
  border-left: 2px solid var(--link);
  background: rgba(59, 74, 67, 0.06);
  color: var(--link);
  font-size: 0.82rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.tag-project { text-transform: lowercase; }

.entry-stamp {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.entry-stamp-tag {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.28rem 0.58rem;
  border-radius: 2px;
  background: var(--link);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.entry-body { min-width: 0; }

.entry-title {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  color: var(--link);
}

a.entry-title { border-bottom-color: transparent; }

a.entry-title:hover {
  color: var(--link-hover);
}

.entry-title-plain { color: var(--text); }

.entry-authors,
.entry-links,
.entry-blurb,
.entry-scale {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.entry-authors strong { color: var(--text); }

.entry-blurb {
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

.entry-links { color: var(--text-muted); }
.entry-links a { color: var(--link); }

.entry-scale { margin-top: 0.6rem; }

.scale-figure {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--link);
  margin-right: 0.5rem;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--text);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.site-footer p { margin: 0 0 0.4rem; }

.footer-stamp { color: var(--text-muted); font-size: 0.75rem; }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .app-shell {
    padding: 1rem 0.875rem;
    padding-left: max(0.875rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.875rem, env(safe-area-inset-right, 0px));
  }

  .bio-section {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .bio-portrait {
    order: -1;
    display: flex;
    justify-content: center;
  }

  .bio-portrait img { width: 100%; height: 100%; }

  .portrait-frame {
    width: 200px;
    height: 200px;
    box-shadow: 8px 8px 0 rgba(59, 74, 67, 0.13);
  }

  .brand-name { font-size: 1.8rem; }

  .entry {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .entry-side {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
  }

  .tag { padding: 0.35rem 0.65rem; }

  .entry-stamp { margin: 0; }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 0.75rem;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .contact-row { justify-content: flex-start; }
}
