:root {
  color-scheme: light;
  --paper: #fff9f8;
  --surface: #fff;
  --ink: #28172b;
  --muted: #655467;
  --border: #eadce6;
  --rose: #823750;
  --pale-rose: #f9e7ed;
  --plum: #351f3d;
  --shadow: 0 12px 36px #3219380c;
  font-family: system-ui, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.6;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
main { padding-bottom: 4.5rem; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, select { font: inherit; }
button { cursor: pointer; }
button[hidden] { display: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid #ae456d; outline-offset: 4px; }
[id] { scroll-margin-top: 5.7rem; }
.shell { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.skip-link { position: fixed; z-index: 3; top: .5rem; left: .5rem; transform: translateY(-150%); padding: .55rem .8rem; background: var(--surface); border: 1px solid var(--border); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid #eadce6b3; }
.header-inner, .primary-nav, .brand { display: flex; align-items: center; }
.header-inner { min-height: 4.4rem; justify-content: space-between; gap: 1.25rem; }
.brand { gap: .55rem; font-size: 1.28rem; font-weight: 820; letter-spacing: -.055em; text-decoration: none; white-space: nowrap; }
.brand-icon { display: grid; width: 2.15rem; height: 2.15rem; place-items: center; border-radius: .7rem; background: var(--pale-rose); color: var(--rose); font-size: 1.12rem; line-height: 1; }
.primary-nav { gap: clamp(.85rem, 3vw, 2.3rem); color: var(--muted); white-space: nowrap; }
.primary-nav a { display: inline-flex; align-items: center; min-height: 2.6rem; font-size: .95rem; font-weight: 680; text-decoration: none; }
.primary-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }
.primary-nav .nav-action { padding: 0 1rem; border: 1px solid #dfc9d7; border-radius: 100px; color: var(--plum); }

.hero { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 20rem; margin-top: 1.8rem; overflow: hidden; border-radius: 1.45rem; background: var(--plum); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 4vw, 4.2rem); background: radial-gradient(ellipse at 1% 105%, #73445e 0, transparent 60%), var(--plum); color: white; }
.hero-label { color: #f3bfd1; font-weight: 720; font-size: .94rem; margin-bottom: .85rem; }
.hero h1 { font-size: clamp(2.85rem, 5vw, 4.6rem); font-weight: 820; line-height: 1.1; letter-spacing: -.085em; word-break: keep-all; }
.hero-description { margin-top: 1.3rem; color: #f0dbe8; max-width: 24rem; font-size: 1rem; word-break: keep-all; }
.featured { position: relative; display: block; min-width: 0; min-height: 100%; color: white; text-decoration: none; }
.featured-image { position: absolute; inset: 0; overflow: hidden; background: #201722; }
.featured-image img { width: 100%; height: 100%; object-fit: cover; object-position: 49% 68%; }
.featured-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, #140d22b0, transparent 50%); pointer-events: none; }
.featured-caption { position: absolute; bottom: 1.35rem; left: 1.5rem; right: 1.2rem; }
.featured-caption p { color: #ffdbe9; font-size: .94rem; }
.featured-caption strong { font-size: clamp(1.14rem, 2.2vw, 1.55rem); letter-spacing: -.055em; }
.featured:hover strong { text-decoration: underline; text-underline-offset: .22em; }
.featured:focus-visible { outline-offset: -5px; outline-color: white; }

.finder { margin-top: 1.4rem; padding: 1.55rem; border: 1px solid var(--border); border-radius: 1.25rem; background: var(--surface); box-shadow: var(--shadow); }
.section-heading { display: flex; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1rem; }
.section-heading h2 { font-size: clamp(1.45rem, 2.7vw, 1.94rem); line-height: 1.23; font-weight: 790; letter-spacing: -.06em; word-break: keep-all; }
.section-heading p { margin-top: .42rem; font-size: .96rem; color: var(--muted); }
.finder-heading { margin-bottom: 1.15rem; }
.gift-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: .75rem; align-items: start; }
.gift-form label { position: relative; min-width: 0; color: var(--plum); font-size: .89rem; font-weight: 720; }
.gift-form label::after { content: ""; position: absolute; bottom: 1.25rem; right: .8rem; width: .48rem; height: .48rem; border: solid var(--rose); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); pointer-events: none; }
.gift-form select { appearance: none; width: 100%; min-height: 2.95rem; margin-top: .32rem; padding: .5rem 1.6rem .5rem .65rem; border: 1px solid var(--border); border-radius: .6rem; color: var(--ink); background: #fffafd; font-size: .92rem; }
.gift-form select:hover { border-color: #b88fa5; }
.form-actions { display: grid; align-content: start; gap: .25rem; padding-top: 1.74rem; }
.primary-button, .clear-button, .category-remove { min-height: 2.55rem; border-radius: .63rem; font-size: .94rem; font-weight: 680; }
.primary-button { min-height: 2.95rem; padding-inline: 1.02rem; color: white; background: var(--plum); border: 1px solid var(--plum); }
.primary-button:hover { background: #56325e; border-color: #56325e; }
.clear-button { background: transparent; color: var(--muted); border: 0; padding-inline: .7rem; }
.clear-button:hover { text-decoration: underline; text-underline-offset: .2em; }

.site-section { margin-top: 3.2rem; }
.results { margin-top: 2rem; }
.cards, .guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.gift-card { display: flex; flex-direction: column; min-width: 0; padding: 1.2rem; border: 1px solid var(--border); border-radius: 1.05rem; background: var(--surface); }
.gift-card.verified { border-color: #d8abcd; background: #fff7fb; }
.card-labels { display: flex; flex-wrap: wrap; gap: .32rem; margin-bottom: .75rem; }
.card-label { padding: .14rem .56rem; border-radius: 100px; background: #f3e9f2; color: #633655; font-size: .85rem; font-weight: 720; }
.card-label + .card-label { background: #f8eef3; color: #6c465d; }
.gift-card h3 { margin-bottom: .35rem; font-size: 1.17rem; line-height: 1.4; font-weight: 780; letter-spacing: -.04em; word-break: keep-all; }
.card-price { margin-bottom: .55rem; font-size: 1.08rem; font-weight: 760; color: #6b2646; }
.card-checked { margin-left: .2rem; color: var(--muted); font-size: .88rem; font-weight: 500; white-space: nowrap; }
.card-summary { color: var(--muted); font-size: .96rem; }
.card-receive { color: var(--muted); font-size: .91rem; margin-top: auto; padding-top: .85rem; }
.card-receive strong { color: var(--ink); }
.card-article { margin-top: .85rem; display: inline-flex; align-items: center; align-self: flex-start; min-height: 2.55rem; padding: .3rem .72rem; border-radius: .53rem; background: var(--plum); color: white; font-size: .9rem; font-weight: 720; text-decoration: none; }
.card-article:hover { background: #56325e; }
.empty-results { grid-column: 1 / -1; padding: 1.35rem; border: 1px dashed #d8b8cd; border-radius: 1rem; background: #fff7fb; }
.empty-results h3 { margin-bottom: .3rem; font-size: 1.12rem; }
.empty-results p { margin-bottom: .75rem; color: var(--muted); }
.category-remove { padding: .25rem .75rem; border: 1px solid var(--border); background: var(--pale-rose); color: var(--rose); flex-shrink: 0; }

.category-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .65rem; }
.category-button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .5rem; min-height: 5.3rem; padding: .75rem; border: 1px solid var(--border); border-radius: .85rem; background: var(--surface); color: var(--plum); text-align: left; font-size: .95rem; font-weight: 710; word-break: keep-all; }
.category-button span { display: grid; place-items: center; width: 1.95rem; height: 1.95rem; background: #f3e4ef; color: #773763; border-radius: .55rem; font-size: 1.09rem; line-height: 1; }
.category-food span, .category-beauty span { background: #fde9ea; color: #823750; }
.category-flowers span, .category-fashion span { background: #f3e8fc; color: #63408a; }
.category-electronics span, .category-living span { background: #efecfe; color: #504285; }
.category-button:hover, .category-button[aria-pressed="true"] { border-color: #9b527c; background: #fbecf3; }

.guide-card { display: block; overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); text-decoration: none; }
.guide-card:hover h3 { text-decoration: underline; text-underline-offset: .2em; }
.guide-card > img { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; object-position: center 64%; background: #f1e2ea; }
.guide-card-content { padding: 1rem 1.12rem 1.2rem; }
.guide-card-content time { color: var(--muted); font-size: .87rem; }
.guide-card-content h3 { margin-top: .27rem; font-size: 1.12rem; line-height: 1.42; letter-spacing: -.04em; word-break: keep-all; }
.guide-card-content p { margin-top: .4rem; color: var(--muted); font-size: .93rem; }

.site-footer { border-top: 1px solid var(--border); background: #f7edf4; color: var(--muted); }
.footer-inner { display: grid; grid-template-columns: 1fr minmax(11rem, 25rem); gap: 1.75rem; padding-block: 1.85rem; }
.footer-inner p { font-size: .9rem; }
.footer-inner .footer-brand { color: var(--ink); font-size: 1.09rem; font-weight: 790; margin-bottom: .15rem; letter-spacing: -.04em; }
.footer-inner summary { cursor: pointer; color: var(--ink); font-size: .94rem; font-weight: 690; }
.footer-inner details p { margin-top: .4rem; }

@media (max-width: 900px) {
  .gift-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-actions { grid-template-columns: 1fr auto; gap: .15rem; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  main { padding-bottom: 3rem; }
  .shell { width: calc(100% - 2rem); }
  .header-inner { min-height: 3.65rem; gap: .5rem; }
  .brand { font-size: 1.03rem; gap: .32rem; }
  .brand-icon { width: 1.75rem; height: 1.75rem; font-size: .93rem; }
  .primary-nav { gap: .49rem; }
  .primary-nav a { font-size: .85rem; }
  .primary-nav .nav-action { padding-inline: .48rem; }
  .hero { margin-top: .9rem; min-height: 0; grid-template-columns: 1fr; border-radius: 1rem; }
  .hero-copy { padding: 1.35rem 1.35rem 1.25rem; }
  .hero-label { margin-bottom: .55rem; font-size: .88rem; }
  .hero h1 { font-size: clamp(2.25rem, 9.2vw, 2.85rem); }
  .hero-description { margin-top: .7rem; max-width: 25rem; font-size: .94rem; }
  .featured { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: center; gap: .8rem; padding: .55rem .75rem; background: #27172e; }
  .featured-image { position: static; height: 3.5rem; border-radius: .45rem; }
  .featured-image::after { content: none; }
  .featured-caption { position: static; }
  .featured-caption p { font-size: .85rem; }
  .featured-caption strong { font-size: 1.01rem; }
  .finder { margin-top: .9rem; padding: .95rem; border-radius: .9rem; }
  .finder-heading { margin-bottom: .85rem; }
  .gift-form { gap: .57rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gift-form select { padding-left: .46rem; padding-right: 1.2rem; font-size: .9rem; }
  .gift-form label::after { right: .55rem; }
  .form-actions { grid-column: 1 / -1; padding-top: .15rem; gap: .28rem; }
  .clear-button { padding-inline: .55rem; }
  .section-heading p { font-size: .91rem; }
  .site-section { margin-top: 2.2rem; }
  .results { margin-top: 1.4rem; }
  .cards, .guide-grid { grid-template-columns: 1fr; gap: .65rem; }
  .gift-card { padding: .95rem; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .42rem; }
  .category-button { min-height: 4.6rem; padding: .55rem; font-size: .89rem; }
  .category-button span { width: 1.65rem; height: 1.65rem; font-size: .95rem; }
  .category-remove { font-size: .85rem; padding-inline: .55rem; }
  .footer-inner { grid-template-columns: 1fr; gap: .75rem; }
}

@media (max-width: 340px) {
  .header-inner, .primary-nav { gap: .35rem; }
  .primary-nav a { font-size: .8rem; }
  .primary-nav .nav-action { padding-inline: .35rem; }
  .brand-icon { display: none; }
}
