:root {
  --page-max: 1200px;
  --paper: #fafaf7;
  --paper2: #ffffff;
  --ink: #0d3d1f;
  --ink-soft: #4a4a44;
  --accent: #1f6b34;
  --line: #c8c8bd;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(var(--line) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  color: #2a2a26;
  font-family: Georgia, 'Times New Roman', serif;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 2.75rem 1rem 1.25rem;
  text-align: center;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  display: block;
  height: clamp(160px, 24vw, 280px);
  width: auto;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
  font-family: Georgia, serif;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  margin: 0 auto 2.5rem;
  width: min(600px, 92vw);
}

.site-nav a.active { color: var(--ink); font-weight: bold; }

/* ---------- Portfolio grid ---------- */
.gallery {
  width: min(100% - 2rem, var(--page-max));
  margin: 0 auto 4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 2.5rem;
  list-style: none;
}

.gallery-item a {
  display: block;
  background: var(--paper2);
  border: 1px solid var(--line);
  box-shadow: 2px 2px 10px rgba(13, 61, 31, .06);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}

.gallery-item a:hover {
  box-shadow: 3px 4px 16px rgba(13, 61, 31, .12);
  transform: translateY(-2px);
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 900 / 700;
  object-fit: cover;
}

.gallery-item .cap {
  padding: 1rem 1.2rem 1.3rem;
}

.gallery-item .cap .kind {
  display: block;
  font-family: Georgia, serif;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .3rem;
}

.gallery-item .cap .title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
}

/* ---------- Project detail ---------- */
.detail {
  width: min(100% - 2rem, 900px);
  margin: 0 auto 4rem;
}

.detail-frame {
  background: var(--paper2);
  border: 1px solid var(--line);
  box-shadow: 3px 4px 16px rgba(13, 61, 31, .08);
  overflow: hidden;
}

.detail-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.detail-body {
  padding: 1.6rem 2rem 2rem;
}

.detail-body .kind {
  display: block;
  font-family: Georgia, serif;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
}

.detail-body h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 2rem;
  margin: 0 0 .75rem;
  color: var(--ink);
}

.detail-body p {
  font-family: Georgia, serif;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 60ch;
}

.detail-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- About ---------- */
.info {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto 4rem;
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: 2.25rem;
  align-items: start;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  box-shadow: 2px 2px 10px rgba(13, 61, 31, .08);
}

.info-card {
  padding: 0;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #2a2a26;
}

.info-card p:first-child { margin-top: 0; }
.info-card h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.8rem;
  color: var(--ink);
  margin: 0 0 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 3rem;
  font-size: .75rem;
  color: #8c8c85;
}

@media (max-width: 700px) {
  .gallery { gap: 1.5rem; }
  .info { grid-template-columns: 1fr; }
  .detail-body { padding: 1.3rem 1.2rem 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
