/* ===== Design tokens ===== */
:root {
  --cream: #faf6f0;
  --milk: #f3ebe3;
  --beige: #e8ddd0;
  --paper: #f7f2ea;
  --wood-light: #d4c4b0;
  --wood: #b89f82;
  --coffee: #6b4f3a;
  --coffee-dark: #3d2817;
  --muted-orange: #c9956a;
  --peach: #e8c4a8;
  --chalk-green: #2d4a3a;
  --brown: #4a3829;
  --brown-light: #7a6554;
  --white: #fffef9;
  --off-white: #faf8f4;
  --shadow: 0 4px 24px rgba(61, 40, 23, 0.1);
  --shadow-soft: 0 8px 32px rgba(61, 40, 23, 0.12);
  --shadow-polaroid: 0 6px 20px rgba(61, 40, 23, 0.14), 0 2px 6px rgba(61, 40, 23, 0.08);
  --radius: 4px;
  --radius-sm: 3px;
  --font-display: "Caveat", cursive;
  --font-heading: "Yuji Boku", serif;
  --font-body: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --texture-paper: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  --texture-washi: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--brown);
  background-color: var(--cream);
  background-image:
    var(--texture-paper),
    linear-gradient(180deg, var(--cream) 0%, var(--milk) 100%);
}

a {
  color: var(--coffee);
  text-decoration: none;
}

a:hover {
  color: var(--muted-orange);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(100% - 2rem, 960px);
  margin-inline: auto;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(184, 159, 130, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--coffee);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo:hover {
  text-decoration: none;
  color: var(--muted-orange);
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--brown-light);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.nav a:hover {
  color: var(--coffee);
  text-decoration: none;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 4.5rem 0 5.5rem;
  text-align: center;
  overflow: hidden;
  background-color: var(--milk);
  background-image:
    var(--texture-paper),
    repeating-linear-gradient(
      92deg,
      transparent,
      transparent 28px,
      rgba(107, 79, 58, 0.03) 28px,
      rgba(107, 79, 58, 0.03) 29px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(184, 159, 130, 0.12) 0px,
      rgba(184, 159, 130, 0.12) 1px,
      transparent 1px,
      transparent 18px
    ),
    linear-gradient(
      165deg,
      #f8f0e6 0%,
      #efe4d6 35%,
      #e6d5c4 70%,
      #dcc9b5 100%
    );
  box-shadow: inset 0 -1px 0 rgba(184, 159, 130, 0.3);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 20%,
    rgba(255, 248, 235, 0.7) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  text-align: center;
}

.hero-content {
  order: 1;
}

.hero-visual {
  order: 2;
  margin: 0;
  padding: 0.5rem;
  background: rgba(255, 254, 249, 0.55);
  border: 1px solid rgba(184, 159, 130, 0.45);
  box-shadow: var(--shadow-soft);
}

.hero-visual img {
  display: block;
  width: 100%;
  max-height: clamp(240px, 42vw, 420px);
  object-fit: cover;
  object-position: center;
}

.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-float {
  position: absolute;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  opacity: 0.75;
  filter: drop-shadow(0 2px 4px rgba(61, 40, 23, 0.12));
  animation: hero-float 5s ease-in-out infinite;
}

.hero-float--1 {
  top: 12%;
  left: 8%;
  animation-delay: 0s;
}

.hero-float--2 {
  top: 18%;
  right: 10%;
  animation-delay: 1.2s;
}

.hero-float--3 {
  top: 8%;
  right: 28%;
  font-size: 0.95em;
  animation-delay: 2.4s;
}

@keyframes hero-float {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

.hero-label {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--brown-light);
  background: rgba(255, 254, 249, 0.85);
  border: 1px solid rgba(184, 159, 130, 0.4);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.hero-title {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 4.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--coffee-dark);
  text-shadow: 1px 2px 0 rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}

.hero-subtitle {
  margin: 0.35rem 0 1rem;
  font-size: clamp(0.8rem, 2.2vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--brown-light);
}

.hero-catch {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
  color: var(--coffee);
}

.hero-desc {
  margin: 0 auto 2rem;
  max-width: 32rem;
  font-size: 0.95rem;
  color: var(--brown);
}

.btn-primary {
  display: inline-block;
  padding: 0.7rem 1.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--off-white);
  background: linear-gradient(180deg, var(--coffee) 0%, var(--coffee-dark) 100%);
  border: 1px solid rgba(61, 40, 23, 0.3);
  border-radius: 2px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  color: var(--white);
}

/* ===== Section common ===== */
.section {
  padding: 4.5rem 0;
}

.section-heading {
  text-align: center;
  margin-bottom: 0.25rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  color: var(--coffee-dark);
  letter-spacing: 0.06em;
}

.section-title--light {
  color: rgba(255, 254, 249, 0.95);
}

.section-ornament {
  width: min(200px, 60%);
  height: 12px;
  margin: 0.5rem auto 0;
  background-image: radial-gradient(circle, var(--wood) 1.5px, transparent 1.5px);
  background-size: 10px 10px;
  background-position: center;
  opacity: 0.55;
}

.section-ornament--wave {
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='8' viewBox='0 0 80 8'%3E%3Cpath d='M0 4 Q10 0 20 4 T40 4 T60 4 T80 4' fill='none' stroke='%23b89f82' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.5;
}

.section-ornament--light {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.5) 1.5px, transparent 1.5px);
  opacity: 0.7;
}

.section-lead {
  margin: 1rem auto 2.75rem;
  max-width: 28rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--brown-light);
}

/* ===== Menu (polaroid) ===== */
.menu-section {
  background-color: var(--paper);
  background-image:
    var(--texture-paper),
    linear-gradient(180deg, var(--paper) 0%, var(--milk) 100%);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.25rem 1.75rem;
  padding: 0.5rem 0 1rem;
}

.menu-card {
  padding: 0.65rem 0.65rem 1.5rem;
  background: var(--off-white);
  box-shadow: var(--shadow-polaroid);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.menu-card--tilt-left {
  transform: rotate(-2.5deg);
}

.menu-card--tilt-center {
  transform: rotate(0.8deg);
}

.menu-card--tilt-right {
  transform: rotate(2deg);
}

.menu-card--tilt-alt {
  transform: rotate(-1.2deg);
}

.menu-card:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-soft);
  z-index: 2;
}

.menu-card-inner {
  background: var(--off-white);
}

.menu-card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(184, 159, 130, 0.25);
  overflow: hidden;
  background: var(--beige);
}

.menu-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.menu-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 28px rgba(61, 40, 23, 0.14);
  pointer-events: none;
}

.menu-card h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.2rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--coffee-dark);
}

.menu-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.menu-price {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--muted-orange);
}

.menu-card p:last-child {
  margin: 0;
  font-size: 0.88rem;
  color: var(--brown-light);
  line-height: 1.7;
}

/* ===== Access ===== */
.access-section {
  background: var(--cream);
}

.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.access-info dl {
  margin: 0;
}

.access-info dt {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--muted-orange);
  letter-spacing: 0.04em;
}

.access-info dt:first-child {
  margin-top: 0;
}

.access-info dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.map-wrap {
  position: relative;
  min-height: 240px;
}

.map-embed {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(184, 159, 130, 0.4);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  background: var(--beige);
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: clamp(300px, 45vw, 400px);
  border: 0;
}

.bean {
  position: absolute;
  width: 22px;
  height: 13px;
  color: var(--wood);
  opacity: 0.45;
  z-index: 0;
}

.bean--1 {
  top: 8%;
  left: 5%;
  transform: rotate(-25deg);
}

.bean--2 {
  top: 15%;
  right: 8%;
  transform: rotate(18deg) scale(0.85);
}

.bean--3 {
  bottom: 12%;
  left: 12%;
  transform: rotate(35deg) scale(1.1);
}

.bean--4 {
  bottom: 8%;
  right: 6%;
  transform: rotate(-12deg) scale(0.9);
}

/* ===== Hours (chalkboard) ===== */
.hours-section {
  padding-bottom: 5rem;
  background:
    linear-gradient(rgba(45, 74, 58, 0.03), rgba(45, 74, 58, 0.03)),
    var(--milk);
}

.hours-card {
  position: relative;
  max-width: 420px;
  margin: 1.5rem auto 0;
  padding: 2.25rem 2rem 2rem;
  text-align: center;
  background-color: var(--chalk-green);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.04) 3px,
      rgba(0, 0, 0, 0.04) 4px
    ),
    linear-gradient(145deg, #2d4a3a 0%, #243d30 50%, #1f3529 100%);
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.15),
    0 8px 28px rgba(45, 74, 58, 0.35);
}

.chalk-mark {
  position: absolute;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1;
}

.chalk-mark--tl {
  top: 0.75rem;
  left: 1rem;
}

.chalk-mark--tr {
  top: 0.85rem;
  right: 1rem;
}

.chalk-mark--bl {
  bottom: 0.85rem;
  left: 1.1rem;
}

.chalk-mark--br {
  bottom: 0.75rem;
  right: 1rem;
}

.hours-main {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.65rem);
  font-weight: 600;
  color: rgba(255, 254, 249, 0.95);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
  letter-spacing: 0.04em;
}

.hours-sub {
  margin: 0.6rem 0 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: rgba(255, 254, 249, 0.75);
}

.hours-closed {
  margin: 1.35rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: rgba(255, 254, 249, 0.8);
}

/* ===== Footer ===== */
.site-footer {
  padding: 2.5rem 0;
  text-align: center;
  background-color: #ebe3d8;
  background-image:
    var(--texture-paper),
    repeating-linear-gradient(
      0deg,
      rgba(107, 79, 58, 0.04) 0px,
      rgba(107, 79, 58, 0.04) 1px,
      transparent 1px,
      transparent 24px
    );
  border-top: 1px solid rgba(184, 159, 130, 0.45);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.footer-thanks {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  color: var(--coffee);
  letter-spacing: 0.04em;
}

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--brown-light);
}

/* ===== Chat Widget ===== */
.chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--coffee-dark);
  background: var(--off-white);
  border: 1px solid rgba(184, 159, 130, 0.5);
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(61, 40, 23, 0.18);
}

.chat-fab[hidden] {
  display: none;
}

.chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(520px, calc(100vh - 2rem));
  background-color: var(--off-white);
  background-image: var(--texture-washi);
  border: 1px solid rgba(184, 159, 130, 0.45);
  border-radius: 3px;
  box-shadow: 0 14px 44px rgba(61, 40, 23, 0.22);
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--milk) 0%, var(--beige) 100%);
  border-bottom: 1px solid rgba(184, 159, 130, 0.35);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.chat-cup-icon {
  flex-shrink: 0;
  display: flex;
  color: var(--coffee);
}

.chat-header h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--coffee-dark);
  line-height: 1.3;
}

.chat-close {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--brown);
  background: rgba(255, 254, 249, 0.8);
  border: 1px solid rgba(184, 159, 130, 0.4);
  border-radius: 2px;
  cursor: pointer;
}

.chat-close:hover {
  background: var(--white);
}

.chat-messages {
  flex: 1;
  min-height: 200px;
  max-height: 320px;
  padding: 1rem;
  overflow-y: auto;
  background-color: rgba(250, 246, 240, 0.85);
  background-image: var(--texture-washi);
}

.chat-message {
  margin-bottom: 0.75rem;
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.6;
  border-radius: 3px;
  word-break: break-word;
}

.chat-message--bot {
  margin-right: auto;
  background: var(--white);
  border: 1px solid rgba(184, 159, 130, 0.25);
  border-bottom-left-radius: 1px;
  box-shadow: var(--shadow);
  color: var(--brown);
}

.chat-message--user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--peach), #dfc4ad);
  border: 1px solid rgba(201, 149, 106, 0.3);
  border-bottom-right-radius: 1px;
  color: var(--coffee-dark);
}

.chat-message--loading {
  color: var(--brown-light);
  font-style: italic;
  background: transparent;
  border: none;
  box-shadow: none;
}

.chat-message--error {
  background: #faf0ec;
  border-color: rgba(160, 68, 51, 0.25);
  color: #8b4030;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid rgba(184, 159, 130, 0.35);
  background: var(--off-white);
}

.chat-input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--brown);
  background: var(--white);
  border: 1px solid var(--beige);
  border-radius: 2px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--muted-orange);
}

.chat-send {
  padding: 0.6rem 0.95rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--off-white);
  background: var(--coffee);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: 0.04em;
}

.chat-send:hover:not(:disabled) {
  background: var(--coffee-dark);
}

.chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    text-align: left;
  }

  .hero-content {
    order: 1;
  }

  .hero-visual {
    order: 2;
  }
}

@media (max-width: 640px) {
  .nav {
    gap: 0.65rem;
    font-size: 0.82rem;
  }

  .hero {
    padding: 3.25rem 0 4rem;
  }

  .hero-float--1 {
    left: 4%;
  }

  .hero-float--3 {
    right: 18%;
  }

  .section {
    padding: 3.25rem 0;
  }

  .menu-card--tilt-left,
  .menu-card--tilt-center,
  .menu-card--tilt-right,
  .menu-card--tilt-alt {
    transform: none;
  }

  .menu-card:hover {
    transform: translateY(-4px);
  }

  .access-grid {
    grid-template-columns: 1fr;
  }

  .chat-fab,
  .chat-panel {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-float {
    animation: none;
  }

  .menu-card,
  .btn-primary,
  .chat-fab {
    transition: none;
  }
}
