:root {
  color-scheme: light;
  --paper: #fff6fa;
  --paper-soft: #ffe7f0;
  --ink: #261721;
  --muted: #7c6672;
  --line: #efd0dc;
  --rose: #eb5488;
  --rose-dark: #bd315f;
  --moss: #667b68;
  --blue: #70558d;
  --white: #fffdfd;
  --shadow: 0 20px 56px rgba(95, 39, 64, 0.14);
  --radius: 8px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fff6fa 0%, #fffdfd 42%, #fff2f6 100%);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

img {
  display: block;
  width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

/* ── Header ── */

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 48px);
  color: var(--white);
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(251, 248, 243, 0.94);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(36, 31, 27, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  border-radius: 999px;
  padding: 8px 12px;
  color: inherit;
  font-size: 14px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.site-header.is-scrolled .site-nav a:hover,
.site-header.is-scrolled .site-nav a:focus-visible {
  background: linear-gradient(135deg, #ffe7f0 0%, #fff5e8 58%, #edf4ea 100%);
}

.menu-toggle {
  display: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 8px 13px;
  background: transparent;
  color: inherit;
}

/* ── Hero ── */

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 86vh;
  padding: 128px clamp(20px, 5vw, 64px) 72px;
  overflow: hidden;
  color: var(--white);
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(48, 20, 36, 0.18) 0%, rgba(48, 20, 36, 0.06) 34%, rgba(48, 20, 36, 0.72) 100%),
    url("photos/hero.jpg") center 20% / cover;
  transform: scale(1.01);
}

.hero-content {
  position: relative;
  width: min(720px, 100%);
}

.kicker {
  margin: 0 0 12px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .kicker {
  color: #f4d4d7;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.03;
}

h1 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 11vw, 132px);
  font-weight: 500;
  font-style: italic;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 500;
}

h3 {
  font-size: 22px;
}

.hero-copy {
  max-width: 490px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(18px, 2.2vw, 23px);
}

.hero-actions,
.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ── Buttons ── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--rose), #f08a72);
  color: var(--white);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: linear-gradient(135deg, var(--rose-dark), #df6a59);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--white);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

/* ── Sections ── */

.section {
  padding: clamp(64px, 9vw, 118px) clamp(20px, 5vw, 64px);
}

.section-heading {
  max-width: 640px;
}

.section-heading p:not(.kicker) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.diary-section,
.wallpapers-section,
.tools-section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

/* ── Filter ── */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 22px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.filter-button.is-active,
.filter-button:hover,
.filter-button:focus-visible {
  border-color: var(--moss);
  background: var(--moss);
  color: var(--white);
  outline: none;
}

/* ── Diary grid ── */

.diary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.diary-card,
.tool-card,
.archive-panel,
.wallpaper-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 253, 0.92);
  box-shadow: 0 10px 30px rgba(95, 39, 64, 0.08);
}

.diary-card {
  overflow: hidden;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.diary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(95, 39, 64, 0.13);
}

.diary-card.is-hidden {
  display: none;
}

.diary-card img {
  height: 350px;
  object-fit: cover;
}

.diary-card-body {
  padding: 20px;
}

.diary-card-body span,
.tool-tag,
.archive-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diary-card-body p,
.tool-card p,
.archive-panel p,
.archive-list {
  color: var(--muted);
}

.diary-card-body p {
  margin: 12px 0 0;
}

/* ── Archive ── */

.archive-section {
  background: linear-gradient(135deg, #ffe7f0 0%, #fff5e8 58%, #edf4ea 100%);
}

.archive-layout,
.letter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: clamp(28px, 6vw, 78px);
  width: min(var(--max), 100%);
  margin: 0 auto;
  align-items: center;
}

.archive-panel {
  padding: clamp(24px, 4vw, 42px);
  box-shadow: var(--shadow);
}

.archive-panel h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
}

.archive-list {
  display: grid;
  gap: 10px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
}

.archive-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.archive-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), #f08a72);
  flex: 0 0 auto;
}

.archive-free {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--moss);
  margin: 0;
}

/* ── Wallpapers ── */

.wallpaper-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.wallpaper-card {
  overflow: hidden;
  transition: transform 260ms ease;
}

.wallpaper-card:hover {
  transform: translateY(-3px);
}

.wallpaper-card img {
  aspect-ratio: 9 / 14;
  object-fit: cover;
}

.wallpaper-card span {
  display: block;
  padding: 14px 16px 16px;
  font-weight: 750;
}

/* ── Clips ── */

.clips-section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

.clips-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.clip-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 253, 0.92);
  box-shadow: 0 10px 30px rgba(95, 39, 64, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform 260ms ease;
}

.clip-card:hover {
  transform: translateY(-3px);
}

.clip-card video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--ink);
}

.clip-card span {
  display: block;
  padding: 14px 16px 16px;
  font-weight: 750;
}

/* ── Tools ── */

.tools-section {
  border-top: 1px solid var(--line);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.tool-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(95, 39, 64, 0.13);
}

.text-link {
  width: fit-content;
  color: var(--rose-dark);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* ── Letter ── */

.letter-section {
  background: linear-gradient(135deg, #eef5ec 0%, #fff1f7 52%, #fff7df 100%);
}

.letter-form {
  border: 1px solid rgba(89, 108, 84, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.82);
  padding: clamp(20px, 4vw, 34px);
}

.letter-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 750;
}

.input-row {
  margin-top: 0;
}

.input-row input {
  flex: 1 1 230px;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 12px 16px;
  color: var(--ink);
}

.input-row input:focus {
  border-color: var(--moss);
  outline: 3px solid rgba(89, 108, 84, 0.18);
}

.form-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ── Footer ── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(20px, 5vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    min-height: 64px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 62px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    padding: 8px;
    color: var(--ink);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    border-radius: 6px;
    padding: 11px 12px;
  }

  .diary-grid,
  .tool-grid,
  .archive-layout,
  .letter-layout {
    grid-template-columns: 1fr;
  }

  .diary-card img {
    height: 300px;
  }

  .wallpaper-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clips-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 82vh;
    padding-bottom: 52px;
  }

  .hero-actions,
  .input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .input-row input {
    width: 100%;
  }

  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .diary-section,
  .wallpapers-section,
  .clips-section,
  .tools-section {
    width: min(100% - 28px, var(--max));
  }

  .diary-grid,
  .wallpaper-strip {
    grid-template-columns: 1fr;
  }

  .clips-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diary-card img {
    height: 260px;
  }

  .site-footer {
    display: block;
  }

  .site-footer p + p {
    margin-top: 8px;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .diary-card,
  .wallpaper-card,
  .tool-card,
  .button {
    transition: none;
  }
}
