/* ============================
   chamomile.studio — design system
   washi paper · ink · one kintsugi seam
   ============================ */

:root {
  --paper: #F3EFE6;
  --paper-deep: #E9E3D4;
  --ink: #221F1C;
  --ink-soft: #58524A;
  --ink-faint: #8C8577;
  --gold: #AD7F35;
  --border: #DFD8C6;

  --font-display: 'Shippori Mincho', serif;
  --font-body: 'EB Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --gutter: max(6vw, 1.5rem);
  --measure: 42rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--gold);
  color: var(--paper);
}

/* ---- Kintsugi seam — the one ornament ---- */

.seam {
  height: 2px;
  margin: 2.75rem 0;
  background: linear-gradient(
    to right,
    var(--gold) 0 21%,
    transparent 21% 25%,
    var(--gold) 25% 61%,
    transparent 61% 65%,
    var(--gold) 65% 100%
  );
  opacity: 0.9;
}

/* ---- Type ---- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
}

h2 {
  font-size: 1.35rem;
  color: var(--ink-soft);
  margin: 3rem 0 1rem;
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 1.75rem 0 0.75rem;
}

p {
  margin: 0 0 1.25rem;
}

strong { font-weight: 600; }
em { font-style: italic; color: var(--ink-soft); }

small {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

a {
  color: var(--ink);
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover { color: var(--gold); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- Page layout — asymmetric, not centered ---- */

.page {
  max-width: var(--measure);
  margin: 0 auto 0 var(--gutter);
  padding: 3.5rem 1.5rem 5rem 0;
}

/* ---- Site header / nav (inner pages) ---- */

.site-header {
  margin-bottom: 0.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover { color: var(--gold); }

.gammadion {
  display: inline-flex;
  width: 0.85em;
  height: 0.85em;
  animation: gentle-rotate 30s linear infinite;
}

.gammadion object {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes gentle-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.site-nav {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.site-nav a:hover { color: var(--gold); }

.site-nav a.current {
  color: var(--gold);
}

/* ---- Footer (inner pages) ---- */

footer {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
}

footer nav a {
  text-decoration: none;
  color: var(--ink-faint);
}

footer nav a:hover { color: var(--gold); }

/* ---- Home page: milk strip ---- */

.milk-strip {
  position: fixed;
  top: 0;
  right: 8vw;
  width: 0.65in;
  height: 100vh;
  background-image: url('assets/images/web/milk-strip.jpg');
  background-size: cover;
  background-position: center;
  border-left: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  opacity: 0.92;
}

@media (max-width: 1000px) {
  .milk-strip {
    display: none;
  }
}

/* ---- Home page: jo-ha-kyū (quiet → development → close) ---- */

.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 34rem;
  margin: 0 auto 0 var(--gutter);
  padding: 3rem 1.5rem;
}

.home-beat {
  opacity: 0;
  animation: rise 0.9s ease forwards;
}

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

/* beat 1 — quiet opening */
.home-quiet {
  animation-delay: 0s;
}

.home-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.home-wordmark .gammadion {
  width: 0.75em;
  height: 0.75em;
}

/* beat 2 — one line of development */
.home-line {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 1.5rem 0 0;
  max-width: 22ch;
  animation-delay: 0.35s;
}

.home-line .gammadion {
  width: 0.8em;
  height: 0.8em;
}

/* beat 3 — fast close into nav */
.home-nav {
  margin-top: 2.5rem;
  animation-delay: 0.85s;
}

.home-nav .seam {
  margin: 0 0 1.5rem;
}

.home-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.home-nav a {
  text-decoration: none;
  color: var(--ink);
}

.home-nav a:hover { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .home-beat { animation: none; opacity: 1; }
  .gammadion { animation: none; }
}

/* ---- About page ---- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}

.portrait {
  width: 130px;
  height: 130px;
  object-fit: cover;
  flex-shrink: 0;
}

.contact-line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.interests {
  list-style: none;
  margin: 0.5rem 0 1rem;
}

.interests li {
  margin-bottom: 0.5rem;
}

/* ---- Gallery ---- */

.gallery-section {
  margin: 0 0 2.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: opacity 0.2s;
}

.gallery img:hover { opacity: 0.85; }

/* ---- Quotes ---- */

.quote-section {
  margin: 0 0 2rem;
}

blockquote {
  border-left: none;
  padding-left: 1.25rem;
  position: relative;
  margin: 1.5rem 0;
  font-style: italic;
  line-height: 1.8;
}

blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold) 0 40%, transparent 40% 55%, var(--gold) 55% 100%);
}

blockquote .attribution {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-top: 0.6rem;
  color: var(--ink-faint);
}

/* ---- Blog / entries list ---- */

.entries {
  list-style: none;
  margin: 0.5rem 0 1rem;
}

.entries li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.entries li:last-child { border-bottom: none; }

.entry-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.section-description {
  color: var(--ink-soft);
  font-style: italic;
}

/* ---- Blog article (single entry) ---- */

.article {
  max-width: var(--measure);
}

.article .meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}

.article h2 {
  margin-top: 2.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.back-link:hover { color: var(--gold); }

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .page {
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .home {
    position: relative;
    margin: 0;
    padding: 0;
    max-width: none;
  }

  .home-line {
    display: none;
  }

  .milk-strip {
    display: block;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .home-quiet {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0.75rem;
    width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    animation: none;
    opacity: 1;
    z-index: 1;
  }

  .quiet-inner {
    transform: rotate(90deg);
    white-space: nowrap;
    color: var(--ink-soft);
  }

  .home-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0.75rem;
    width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    animation: none;
    opacity: 1;
    z-index: 1;
  }

  .home-nav .seam {
    display: none;
  }

  .home-nav nav {
    transform: rotate(-90deg);
    white-space: nowrap;
    flex-wrap: nowrap;
  }

  .home-nav a {
    color: var(--ink);
  }

  .home-nav a:hover {
    color: var(--gold);
  }

  .profile {
    flex-direction: column;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}
