:root {
  --accent: #174a44;
  --accent-soft: #2f6a63;
  --bg-cream: #f8f1e7;
  --ink: #1f2a28;
  --ink-muted: #4f615d;
  --card: #fff9f0cc;
  --line: #174a4430;
  --shadow: 0 14px 45px #174a4418;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Avenir Next", sans-serif;
  color: var(--ink);
  background: var(--bg-cream);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body.modal-open {
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  pointer-events: none;
  inset: auto;
  border-radius: 999px;
  filter: blur(14px);
  z-index: -1;
  animation: drift 12s ease-in-out infinite alternate;
}

.bg-layer-1 {
  width: 28rem;
  height: 28rem;
  top: -8rem;
  right: -6rem;
  background: radial-gradient(circle, #ead8bc, #ead8bc20 70%);
}

.bg-layer-2 {
  width: 34rem;
  height: 34rem;
  bottom: -12rem;
  left: -12rem;
  background: radial-gradient(circle, #b8d4cf80, #b8d4cf10 68%);
  animation-duration: 18s;
}

.site-header {
  width: min(1080px, 92%);
  margin: 1.25rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3a8;
  backdrop-filter: blur(6px);
}

.brand {
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.03em;
}

nav {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.25s ease;
}

nav a:hover {
  color: var(--accent-soft);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.social-links a {
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--accent);
  background: #fffbf4;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
  transform: translateY(-2px);
  border-color: #174a4460;
  box-shadow: 0 8px 20px #174a4414;
}

.header-social {
  margin-left: auto;
}

main {
  width: min(1080px, 92%);
  margin: 2.5rem auto 4rem;
}

.hero h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
}

.hero {
  background: linear-gradient(145deg, #fffaf3, #f6ecdf);
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  padding: clamp(1.5rem, 3vw, 2.7rem);
  box-shadow: var(--shadow);
}

.hero-tag {
  margin: 0;
  color: var(--accent-soft);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0.7rem 0 0;
  line-height: 1.1;
  font-size: clamp(2rem, 4.4vw, 3.45rem);
}

.hero h1 .hero-subtitle {
  display: block;
  color: var(--accent);
}

.greeting-text {
  color: var(--accent);
  display: inline-block;
}

.hero-intro {
  margin-top: 1rem;
  max-width: 62ch;
  color: var(--ink-muted);
  line-height: 1.65;
}

.hero-social {
  margin-top: 1.1rem;
}

.hero-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.pill {
  border: 1px solid var(--line);
  background: #fffbf4;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
}

.curiosity-card {
  margin-top: 1.2rem;
  background: #174a440e;
  border-left: 4px solid var(--accent);
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
}

.curiosity-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.curiosity-card strong {
  display: inline-block;
  margin-top: 0.2rem;
  color: var(--accent);
}

.panel {
  margin-top: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  padding: clamp(1.2rem, 2.8vw, 2rem);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.section-head p {
  color: var(--ink-muted);
  margin: 0.35rem 0 0;
}

.project-grid {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.now-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.now-card {
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  padding: 0.95rem;
  background: #fffdf8;
}

.now-label {
  margin: 0;
  color: var(--accent-soft);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.now-value {
  margin: 0.55rem 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.build-log-list {
  position: relative;
  margin-top: 1rem;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.9rem;
}

.build-log-list::before {
  content: "";
  position: absolute;
  left: 0.36rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #174a4433;
}

.build-log-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #fffdf8;
  padding: 0.75rem 0.85rem;
}

.build-log-item::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 0.95rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px #174a4414;
}

.build-log-date {
  margin: 0;
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.build-log-title {
  margin: 0.36rem 0 0;
  color: var(--accent);
  font-weight: 800;
}

.build-log-note {
  margin: 0.28rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.build-log-status {
  margin: 0.55rem 0 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.build-log-link {
  display: inline-block;
  margin-top: 0.48rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid #174a4440;
  font-size: 0.86rem;
}

.project-card {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: #174a4460;
  box-shadow: 0 10px 30px #174a4414;
}

.project-card:focus-visible {
  outline: 2px solid #174a4482;
  outline-offset: 2px;
}

.project-card h3 {
  margin: 0;
  color: var(--accent);
}

.project-card p {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.project-link {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid #174a4440;
}

.project-link:hover {
  color: var(--accent-soft);
  border-bottom-color: #174a4470;
}

.project-status {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--accent-soft);
  font-weight: 700;
  font-size: 0.84rem;
  border: 1px solid #174a4432;
  background: #174a440b;
  padding: 0.34rem 0.56rem;
  border-radius: 999px;
}

.chip-row {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  color: #123f3a;
  background: #174a4410;
  border: 1px solid #174a4427;
}

.photo-strip {
  display: grid;
  margin-top: 1rem;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.photo-card {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  cursor: pointer;
  background:
    linear-gradient(175deg, #fffdfa, #f5e9d9),
    repeating-linear-gradient(45deg, #0000, #0000 10px, #174a4404 10px, #174a4404 20px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  border-color: #174a4460;
  box-shadow: 0 10px 24px #174a4412;
}

.photo-card:focus-visible {
  outline: 2px solid #174a4482;
  outline-offset: 2px;
}

.photo-card h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--accent);
}

.photo-card p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
}

.about-text {
  margin: 0.75rem 0 0;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 72ch;
}

.about-grid {
  margin-top: 1.4rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  align-items: stretch;
}

.book-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.book-label {
  margin: 0;
  color: var(--accent-soft);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.book-count {
  margin: 0.45rem 0 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
}

.book-count strong {
  color: var(--accent);
  font-size: clamp(2rem, 4.2vw, 2.8rem);
  line-height: 1;
}

.book-progress {
  margin-top: 0.8rem;
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: #174a441a;
  overflow: hidden;
}

.book-progress-fill {
  display: block;
  width: calc((5 / 52) * 100%);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #174a44, #2f6a63);
}

.book-current {
  margin: 0.95rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.book-title {
  margin: 0.25rem 0 0;
  color: var(--accent);
  font-weight: 700;
}

.book-author {
  margin: 0.2rem 0 0;
  color: var(--ink-muted);
}

.site-footer {
  width: min(1080px, 92%);
  margin: 0 auto 2.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.project-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.24s ease;
  z-index: 15;
}

.project-modal.open {
  display: grid;
  opacity: 1;
}

.project-modal-backdrop {
  border: 0;
  position: absolute;
  inset: 0;
  background: #1f2a2854;
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.project-modal-panel {
  position: relative;
  width: min(980px, 96%);
  max-height: 92vh;
  overflow-y: auto;
  background: #fffbf5;
  border: 1px solid #174a4448;
  border-radius: 1.1rem;
  padding: 1rem;
  box-shadow: 0 18px 45px #174a4428;
  transform: translateY(8px) scale(0.985);
  transition: transform 0.24s ease;
}

.project-modal.open .project-modal-panel {
  transform: translateY(0) scale(1);
}

.project-modal-close {
  border: 1px solid var(--line);
  background: #fffbf4;
  color: var(--accent);
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  display: block;
}

#project-modal-image {
  width: 100%;
  height: min(70vh, 640px);
  margin-top: 0.7rem;
  object-fit: contain;
  object-position: center;
  border-radius: 0.8rem;
  border: 1px solid #174a4438;
  background: #0f1b1824;
}

.project-modal-media-wrap {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.35rem;
  border-radius: 0.85rem;
  background: #174a440c;
}

.project-modal-nav {
  border: 1px solid var(--line);
  background: #fffbf4;
  color: var(--accent);
  border-radius: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.project-modal-nav[hidden] {
  visibility: hidden;
}

.project-modal-thumbs {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

.project-modal-thumbs[hidden] {
  display: none;
}

.project-modal-thumbs button {
  border: 1px solid #174a4430;
  border-radius: 0.5rem;
  padding: 0;
  width: 6rem;
  height: 4.1rem;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  opacity: 0.82;
}

.project-modal-thumbs button.active {
  opacity: 1;
  border-color: #174a4478;
  box-shadow: 0 0 0 2px #174a441a;
}

.project-modal-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#project-modal-title {
  margin: 0.9rem 0 0;
  color: var(--accent);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
}

#project-modal-description {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  line-height: 1.6;
}

.project-modal-tags {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-modal-tags[hidden] {
  display: none;
}

.project-modal-tags span {
  font-size: 0.78rem;
  padding: 0.3rem 0.52rem;
  border-radius: 999px;
  color: #123f3a;
  background: #174a4410;
  border: 1px solid #174a4427;
  font-weight: 700;
}

#project-modal-link {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid #174a4440;
}

#project-modal-link[hidden] {
  display: none;
}

.photo-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.24s ease;
  z-index: 20;
}

.photo-modal.open {
  display: grid;
  opacity: 1;
}

.photo-modal-backdrop {
  border: 0;
  position: absolute;
  inset: 0;
  background: #1f2a2860;
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.photo-modal-panel {
  position: relative;
  width: min(900px, 96%);
  max-height: 92vh;
  overflow-y: auto;
  background: #fffbf5;
  border: 1px solid #174a4448;
  border-radius: 1.1rem;
  padding: 1rem;
  box-shadow: 0 18px 45px #174a4428;
  transform: translateY(8px) scale(0.985);
  transition: transform 0.24s ease;
}

.photo-modal.open .photo-modal-panel {
  transform: translateY(0) scale(1);
}

.photo-modal-panel.photo-modal-landscape {
  width: min(980px, 96%);
}

.photo-modal-panel.photo-modal-portrait {
  width: min(560px, 94%);
}

.photo-modal-close {
  border: 1px solid var(--line);
  background: #fffbf4;
  color: var(--accent);
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  display: block;
}

#photo-modal-image {
  width: 100%;
  height: min(62vh, 560px);
  margin-top: 0.7rem;
  object-fit: contain;
  object-position: center;
  border-radius: 0.8rem;
  border: 1px solid #174a4438;
  background: #0f1b1822;
}

.photo-modal-panel.photo-modal-portrait #photo-modal-image {
  height: min(78vh, 920px);
}

#photo-modal-title {
  margin: 0.9rem 0 0;
  color: var(--accent);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
}

#photo-modal-description {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes drift {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(16px) translateX(-12px);
  }
}

@media (max-width: 760px) {
  .site-header {
    border-radius: 1rem;
    align-items: flex-start;
    gap: 0.85rem;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .header-social {
    margin-left: 0;
  }

  .site-footer {
    flex-direction: column;
  }

  .project-modal-panel {
    padding: 0.85rem;
  }

  #project-modal-image {
    height: min(58vh, 560px);
  }

  .photo-modal-panel {
    padding: 0.85rem;
  }

  .photo-modal-panel.photo-modal-portrait {
    width: min(96vw, 560px);
  }

  #photo-modal-image {
    height: min(56vh, 520px);
  }

  .photo-modal-panel.photo-modal-portrait #photo-modal-image {
    height: min(72vh, 860px);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}
