:root {
  --bg: #f5f5f4; /* stone-100 */
  --ink: #292524; /* stone-800 */
  --muted: #78716c; /* stone-500 */
  --line: #44403c; /* stone-700 */
  --hairline: #d6d3d1; /* stone-300 */
  --black: #000000;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Garamond, "EB Garamond", Georgia, "Times New Roman", serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
}

.app {
  width: 100%;
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* —— Brand + nav bar ——————————————————————————————————————————— */

.bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

[data-view="section"] .bar {
  flex-direction: row;
}

/* Home and section boxes share an aspect ratio (≈1.3) so the FLIP animation in
   main.js can scale the box uniformly (no text distortion) as it slides. */
.brand {
  width: 320px;
  height: 96px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  will-change: transform;
}

.brand-name {
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-align: center;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.nav a {
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.current {
  color: var(--ink);
}

/* —— Section (non-home) state ——————————————————————————————————— */

[data-view="section"] .brand {
  width: 146px;
  height: 44px;
}

[data-view="section"] .brand-name {
  font-size: 20px;
}

/* —— Panels —————————————————————————————————————————————————————— */

.panels {
  width: 100%;
  max-width: 30rem;
}

.panel {
  display: none;
  text-align: center;
  animation: fade 0.5s ease 0.12s both;
}

.panel.active {
  display: block;
}

[data-view="home"] .panels {
  display: none;
}

.panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel li {
  display: flex;
  flex-direction: column;
}

.panel p {
  margin: 0 0 10px;
}

.line {
  font-size: 1.05rem;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
}

.line-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.action:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}

.action svg {
  display: block;
  flex: none;
}

.contact-email {
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-email:hover {
  color: var(--ink);
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— Footer ——————————————————————————————————————————————————————— */

.navbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  color: var(--muted);
}

.contact-email,
.meta-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

/* display:contents lets the email/copyright flow inline in the navbar row on home,
   then hide entirely in a section (they fade in at the bottom instead). */
.inline-meta {
  display: contents;
}

[data-view="section"] .inline-meta {
  display: none;
}

.footer {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

[data-view="section"] .footer {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .brand-name,
  .panel {
    transition: none;
    animation: none;
  }
}

/* —— Mobile ——————————————————————————————————————————————————————— */

@media (max-width: 600px) {
  main {
    padding: 44px 16px 76px;
  }

  /* One line doesn't fit on a phone — let the row wrap, drop the dots. */
  .navbar {
    flex-wrap: wrap;
    white-space: normal;
    row-gap: 4px;
  }

  .dot {
    display: none;
  }

  /* Smaller box, same ~1.3 aspect so the slide stays distortion-free. */
  .brand {
    width: 260px;
    height: 78px;
    max-width: 100%;
  }

  .brand-name {
    font-size: 36px;
  }
}

@media (max-width: 380px) {
  .brand {
    width: 216px;
    height: 65px;
  }

  .brand-name {
    font-size: 30px;
  }
}
