:root {
  --ink: #283a30;
  --muted: #617268;
  --forest: #3f7457;
  --forest-dark: #2b5740;
  --leaf: #88a785;
  --cream: #f4f0e6;
  --paper: #fbfdf8;
  --mist: #dcebdd;
  --surface-soft: rgba(246, 251, 244, 0.72);
  --surface-strong: rgba(242, 249, 241, 0.92);
  --sun: #d8c77d;
  --blush: #d7b5ad;
  --line: rgba(63, 116, 87, 0.17);
  --shadow: 0 20px 54px rgba(43, 87, 64, 0.12);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", serif;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(232, 215, 174, 0.42), transparent 28rem),
    radial-gradient(circle at 90% 22%, rgba(176, 207, 177, 0.3), transparent 32rem),
    linear-gradient(155deg, rgba(255, 255, 255, 0.48), transparent 52%),
    var(--cream);
  font-family: var(--sans);
  line-height: 1.75;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(63, 116, 87, 0.1) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  content: "";
  opacity: 0.42;
  pointer-events: none;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 30;
  padding: 8px 14px;
  color: white;
  background: var(--forest-dark);
  border-radius: 99px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.app-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 28px 120px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand img {
  border: 1px solid rgba(47, 95, 70, 0.24);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(47, 95, 70, 0.14);
}

.brand span {
  display: grid;
  line-height: 1.25;
}

.brand strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.install-button,
.favorite-button,
.load-more,
.empty-state button {
  border: 1px solid var(--forest);
  border-radius: 99px;
  color: var(--forest-dark);
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.install-button {
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 700;
}

.install-button:hover,
.favorite-button:hover,
.load-more:hover,
.empty-state button:hover,
.install-button:focus-visible,
.favorite-button:focus-visible,
.load-more:focus-visible,
.empty-state button:focus-visible {
  color: white;
  background: var(--forest);
  transform: translateY(-2px);
}

.today-section {
  min-height: 690px;
  padding: 58px 2vw 86px;
}

.today-panel {
  display: grid;
  grid-template-columns: minmax(390px, 1.08fr) minmax(0, 0.92fr);
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(47, 95, 70, 0.18);
  border-radius: 42px 14px 42px 14px;
  background: linear-gradient(145deg, var(--paper), #f2f8ef);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--forest);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.today-copy #today-basis {
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
}

.today-copy h1,
.section-heading h2,
.gallery-heading h2,
.install-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.45;
}

.today-copy h1 {
  color: var(--forest-dark);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.4;
  letter-spacing: 0.12em;
}

.today-copy {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 6vw, 78px) clamp(28px, 4vw, 52px);
  background: linear-gradient(150deg, rgba(251, 253, 248, 0.96), rgba(235, 245, 233, 0.9));
}

.today-flower-name {
  max-width: 100%;
  margin: 12px 0 0;
  color: var(--forest-dark);
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.3vw, 4.6rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.today-intro {
  max-width: 34rem;
  margin: 22px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.98rem;
}

.today-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 99px;
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 24px rgba(47, 95, 70, 0.2);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--forest-dark);
}

.favorite-button {
  min-height: 48px;
  padding: 10px 20px;
}

.favorite-button[aria-pressed="true"] {
  color: white;
  background: var(--forest);
}

.today-visual {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  margin: 0;
  background: var(--mist);
}

.today-visual::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(23, 38, 29, 0.04), transparent 58%, rgba(23, 38, 29, 0.2));
  content: "";
  pointer-events: none;
}

.today-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.birth-month-link {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin-top: 18px;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.search-section,
.gallery-section,
.favorites-section {
  padding: 82px 2vw;
  border-top: 1px solid var(--line);
}

.section-heading h2,
.gallery-heading h2,
.install-dialog h2 {
  font-size: clamp(1.9rem, 3.5vw, 3.15rem);
}

.search-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  max-width: 760px;
  min-height: 70px;
  margin-top: 36px;
  padding: 0 22px;
  border: 1px solid rgba(47, 95, 70, 0.2);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: 0 12px 36px rgba(36, 59, 45, 0.07);
}

.search-field > span {
  color: var(--forest);
  font-size: 1.8rem;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}

.search-field button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.filter-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-top: 32px;
}

.filter-group {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
}

.birth-date-filter {
  max-width: 760px;
  margin-top: 32px;
}

.birth-date-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.birth-date-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.birth-date-controls select {
  min-width: 112px;
  min-height: 46px;
  padding: 8px 34px 8px 14px;
  border: 1px solid rgba(47, 95, 70, 0.24);
  border-radius: 13px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 0.88rem;
}

.birth-date-controls select:focus-visible {
  outline: 3px solid rgba(47, 95, 70, 0.18);
  outline-offset: 2px;
}

.birth-date-controls select:disabled {
  opacity: 0.52;
}

.birth-date-controls p {
  flex: 1 1 250px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.filter-title {
  display: flex;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.filter-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.filter-title small {
  color: var(--muted);
  font-size: 0.72rem;
}

.season-filters,
.color-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid rgba(47, 95, 70, 0.2);
  border-radius: 99px;
  color: var(--ink);
  background: var(--paper);
  font-size: 0.8rem;
  cursor: pointer;
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--forest);
  color: white;
  background: var(--forest);
}

.color-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(35, 52, 43, 0.18);
  border-radius: 50%;
  background: var(--chip-color);
}

.filter-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 22px 24px;
  border: 1px solid rgba(47, 95, 70, 0.2);
  border-radius: 20px;
  background: rgba(246, 251, 244, 0.84);
}

.filter-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.filter-action-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.filter-action-buttons .primary-action,
.filter-reset {
  min-height: 48px;
  padding: 10px 20px;
  white-space: nowrap;
}

.filter-reset {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.filter-reset:hover,
.filter-reset:focus-visible {
  color: var(--forest-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.gallery-heading {
  display: block;
}

.gallery-heading h2 {
  display: flex;
  gap: clamp(24px, 3vw, 42px);
  align-items: baseline;
  white-space: nowrap;
}

.gallery-result-summary {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.48em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#result-count {
  display: inline-block;
  margin-inline-start: clamp(8px, 1vw, 12px);
  color: var(--forest-dark);
  font-size: 1em;
  font-weight: 700;
}

.flower-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 20px;
  margin-top: 28px;
}

.flower-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 10px 36px rgba(36, 59, 45, 0.08);
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.flower-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.flower-link {
  display: block;
  text-decoration: none;
}

.image-frame {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: var(--mist);
}

.image-frame img {
  width: 100%;
  height: 100%;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
  object-fit: cover;
}

.flower-card:hover .image-frame img {
  transform: scale(1.035);
}

.flower-card-copy {
  display: flex;
  min-height: 76px;
  padding: 16px 15px 16px 20px;
  align-items: center;
  gap: 12px;
}

.flower-title-link {
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.flower-card-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.5;
}

.flower-title-link:hover,
.flower-title-link:focus-visible {
  color: var(--forest);
}

.card-favorite {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(47, 95, 70, 0.22);
  border-radius: 50%;
  color: var(--forest);
  background: #f7fbf5;
  font-size: 1.1rem;
  cursor: pointer;
}

.card-favorite[aria-pressed="true"] {
  color: white;
  background: var(--forest);
}

.load-more {
  display: block;
  min-width: 180px;
  margin: 40px auto 0;
  padding: 11px 24px;
}

.empty-state {
  margin-top: 36px;
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
}

.empty-state button {
  padding: 8px 16px;
}

.favorites-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.favorite-strip {
  display: grid;
  grid-auto-columns: minmax(220px, 27%);
  grid-auto-flow: column;
  gap: 16px;
  overflow-x: auto;
  margin-top: 28px;
  padding: 4px 4px 18px;
  scrollbar-color: var(--leaf) transparent;
}

.favorite-strip .flower-card-copy {
  min-height: 76px;
}

.favorite-empty {
  grid-column: 1 / -1;
  padding: 26px 0;
  color: var(--muted);
  font-family: var(--serif);
}

.source-note {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin: 30px 2vw 0;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(240, 248, 239, 0.68);
}

.source-note p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.source-note a {
  flex: none;
  color: var(--forest);
  font-weight: 700;
  text-decoration: none;
}

.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(47, 95, 70, 0.16);
  border-radius: 24px;
  background: rgba(239, 248, 239, 0.93);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 46px rgba(36, 59, 45, 0.16);
  transform: translateX(-50%);
}

.bottom-nav a {
  display: grid;
  min-width: 70px;
  padding: 7px 12px;
  border-radius: 17px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.bottom-nav a:hover,
.bottom-nav a:focus-visible {
  color: white;
  background: var(--forest);
}

.bottom-nav span {
  font-size: 1.1rem;
}

.install-dialog {
  width: min(90vw, 520px);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  color: var(--ink);
  background: linear-gradient(155deg, #fbfdf8, #eff7ed);
  box-shadow: var(--shadow);
}

.install-dialog::backdrop {
  background: rgba(22, 35, 28, 0.46);
  backdrop-filter: blur(4px);
}

.install-dialog p:not(.eyebrow) {
  color: var(--muted);
}

.install-dialog h2 span {
  display: block;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--mist);
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal {
  animation: reveal 650ms both;
  animation-timeline: view();
  animation-range: entry 4% cover 28%;
}

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

@media (max-width: 860px) {
  .app-shell {
    padding-inline: 18px;
  }

  .today-section {
    min-height: auto;
    padding: 48px 0 70px;
  }

  .today-panel {
    grid-template-columns: 1fr;
    border-radius: 32px 12px 32px 12px;
  }

  .today-copy {
    order: -1;
    padding: 44px 38px;
  }

  .today-visual {
    min-height: 520px;
  }

  .filter-layout {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .favorite-strip {
    grid-auto-columns: minmax(230px, 65%);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 0 14px 108px;
  }

  .site-header {
    min-height: 78px;
  }

  .brand strong {
    font-size: 0.96rem;
  }

  .brand small {
    font-size: 0.62rem;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .install-button {
    padding: 8px 11px;
    font-size: 0.7rem;
  }

  .today-section {
    padding-top: 36px;
  }

  .today-panel {
    border-radius: 26px 10px 26px 10px;
  }

  .today-copy {
    padding: 34px 24px 32px;
  }

  .today-copy h1 {
    font-size: 1.25rem;
  }

  .today-flower-name {
    font-size: clamp(2.6rem, 13vw, 3.6rem);
  }

  .today-intro {
    margin-top: 18px;
    font-size: 0.91rem;
  }

  .today-actions {
    margin-top: 24px;
  }

  .primary-action,
  .favorite-button {
    flex: 1 1 auto;
    font-size: 0.78rem;
  }

  .today-visual {
    min-height: 390px;
  }

  .search-section,
  .gallery-section,
  .favorites-section {
    padding: 62px 0;
  }

  .search-field {
    min-height: 60px;
    padding-inline: 16px;
  }

  .filter-group {
    padding: 20px 16px;
  }

  .birth-date-controls p {
    flex-basis: 100%;
    margin-bottom: 0;
  }

  .filter-title {
    display: block;
  }

  .filter-title small {
    display: block;
    margin-top: 3px;
  }

  .filter-action-buttons {
    width: 100%;
  }

  .filter-action-buttons .primary-action {
    flex: 1;
  }

  .gallery-heading h2 {
    gap: clamp(12px, 4vw, 18px);
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .flower-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .image-frame {
    aspect-ratio: 7 / 5;
  }

  .flower-card-copy {
    min-height: 72px;
  }

  .favorite-strip {
    grid-auto-columns: 84%;
  }

  .source-note {
    display: block;
    margin-inline: 0;
    padding: 22px;
  }

  .source-note a {
    display: inline-block;
    margin-top: 12px;
  }

  .bottom-nav {
    right: 10px;
    bottom: 10px;
    left: 10px;
    justify-content: space-around;
    transform: none;
  }

  .bottom-nav a {
    min-width: 60px;
    padding-inline: 8px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
