/* ==========================================================================
   Logan'sCafe: a concept business website by MadeByMyst.
   Warm and plain: good photos, a printed-style menu, the story, the hours.
   Written mobile-first. Larger screens are added with min-width queries.
   ========================================================================== */

/* DESIGN TOKENS */

:root {
  /* Colours */
  --cream: #f5efe6;
  --cream-2: #efe5d6;
  --cream-3: #fbf7f1;
  --espresso: #40220b;
  --espresso-2: #2a1506;
  --amber: #d9b688;
  --amber-dark: #a8814f;
  --text: #2a1506;
  --text-muted: rgba(42, 21, 6, 0.72);
  --on-dark: #f5efe6;
  --on-dark-muted: rgba(245, 239, 230, 0.75);
  --line: rgba(64, 34, 11, 0.14);
  --line-dark: rgba(245, 239, 230, 0.16);
  --open: #8fd19e;
  --closed: #f0a08a;

  /* Type */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", sans-serif;
  --font-script: "Monsieur La Doulaise", cursive;

  /* Shape & layout */
  --radius: 12px;
  --container: 1120px;
  --gutter: 24px;
  --header-h: 76px;

  /* Motion: one long, soft ease-out */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* RESET & BASE */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--amber);
  color: var(--espresso-2);
}

:focus-visible {
  outline: 2px solid var(--amber-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

/* TYPOGRAPHY */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.8rem, 6.6vw, 5.4rem);
  line-height: 1.04;
}

h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  color: var(--text-muted);
  text-wrap: pretty;
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* LAYOUT HELPERS */

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.section {
  padding-block: clamp(80px, 11vw, 128px);
}

.section-top {
  max-width: 600px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-top p {
  margin-top: 12px;
  font-size: 1.1rem;
}

.concept-note {
  font-size: 0.88rem;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--amber);
  color: var(--espresso-2);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* BUTTONS (the original Logan'sCafe button: amber slides in from the left) */

.dy-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 13px 28px;
  overflow: hidden;
  border: 2px solid var(--amber);
  background-color: transparent;
  color: var(--amber);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dy-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--amber);
  transform: translateX(-101%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dy-btn:hover::before {
  transform: translateX(0);
}

.dy-btn:hover {
  color: var(--espresso);
  box-shadow: 0 6px 24px rgba(217, 182, 136, 0.35);
}

/* The quiet text link that sat next to it in the hero */
.ghost-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ghost-link:hover {
  color: var(--amber);
}

/* HEADER
   Transparent over the hero photo, solid espresso once scrolled.
   Hides while scrolling down and comes back when scrolling up. */

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  color: var(--on-dark);
  transition:
    transform 0.6s var(--ease-out),
    background-color 0.4s ease;
}

.site-header.is-scrolled,
.site-header.menu-is-open {
  background-color: var(--espresso-2);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.site-header:focus-within {
  transform: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

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

.brand img {
  width: 38px;
  height: auto;
}

.brand span {
  font-family: var(--font-script);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--amber);
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.site-nav a:not(.dy-btn) {
  color: var(--on-dark-muted);
  font-size: 0.97rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-nav a:not(.dy-btn):hover {
  color: var(--cream);
}

/* Menu button (only on small screens, and only with JavaScript) */
.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle .bar {
  position: absolute;
  right: 12px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--cream);
  transition:
    translate 0.5s var(--ease-out),
    rotate 0.5s var(--ease-out),
    opacity 0.3s ease;
}

.menu-toggle .bar:nth-child(2) {
  top: 14px;
}

.menu-toggle .bar:nth-child(3) {
  top: 20px;
}

.menu-toggle .bar:nth-child(4) {
  top: 26px;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
  translate: 0 6px;
  rotate: 45deg;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(4) {
  translate: 0 -6px;
  rotate: -45deg;
}

@media (max-width: 860px) {
  /* Without JavaScript the links simply wrap under the logo */
  html:not(.js) .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 14px;
  }

  .js .menu-toggle {
    display: block;
  }

  /* The open menu fills the screen below the header */
  .js .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    padding: 8px var(--gutter) 32px;
    overflow-y: auto;
    background-color: var(--espresso-2);
    visibility: hidden;
    opacity: 0;
    transition:
      opacity 0.4s ease,
      visibility 0s linear 0.4s;
  }

  .js .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
  }

  .js .site-nav a:not(.dy-btn) {
    padding: 16px 2px;
    font-family: var(--font-display);
    font-size: 1.7rem;
    color: var(--cream);
    border-bottom: 1px solid var(--line-dark);
  }

  .js .site-nav .dy-btn {
    width: 100%;
    margin-top: 24px;
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* HERO */

.hero {
  position: relative;
  display: grid;
  align-content: center;
  min-height: min(100vh, 920px);
  padding-block: calc(var(--header-h) + 48px) 96px;
  overflow: hidden;
  background-color: var(--espresso-2);
  color: var(--on-dark);
}

/* The photo drifts a little slower than the page (see script.js) */
.hero-bg {
  position: absolute;
  inset: -10% 0 0;
  translate: 0 calc(var(--parallax, 0) * 1px);
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: settle 2.8s var(--ease-out) backwards;
}

@keyframes settle {
  from {
    opacity: 0;
    scale: 1.12;
  }
}

/* Darken the left side so the text is easy to read */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(42, 21, 6, 0.94) 0%, rgba(42, 21, 6, 0.7) 45%, rgba(42, 21, 6, 0.25) 100%),
    linear-gradient(0deg, rgba(42, 21, 6, 0.7) 0%, transparent 30%),
    linear-gradient(180deg, rgba(42, 21, 6, 0.6) 0%, transparent 25%);
  pointer-events: none;
}

.hero-content,
.special,
.scroll-cue {
  position: relative;
  z-index: 1;
}

/* "Open now · until 9pm" pill (text set by script.js) */
.open-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-bottom: 26px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background-color: rgba(245, 239, 230, 0.08);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cream);
}

.open-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--amber);
}

.open-status.is-open::before {
  background-color: var(--open);
  animation: breathe 2.4s ease-out infinite;
}

.open-status.is-closed::before {
  background-color: var(--closed);
}

@keyframes breathe {
  0% {
    box-shadow: 0 0 0 0 rgba(143, 209, 158, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(143, 209, 158, 0);
  }
}

.hero-title {
  max-width: 11em;
  margin-bottom: 26px;
  color: var(--cream);
}

.hero-title .accent {
  font-style: italic;
  font-weight: 600;
  color: var(--amber);
}

/* Each line slides up from behind a mask when the page loads */
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.hero-title .line > span {
  display: inline-block;
  animation: line-up 1.4s var(--ease-out) 0.35s backwards;
}

.hero-title .line:nth-child(2) > span {
  animation-delay: 0.5s;
}

@keyframes line-up {
  from {
    translate: 0 110%;
    rotate: 3deg;
  }
}

.hero-fade {
  animation: fade-up 1.3s var(--ease-out) 0.7s backwards;
}

.open-status.hero-fade {
  animation-delay: 0.2s;
}

.actions.hero-fade {
  animation-delay: 0.82s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    translate: 0 22px;
  }
}

.lead {
  max-width: 31em;
  font-size: clamp(1.08rem, 1.5vw, 1.2rem);
  color: var(--on-dark-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 36px;
}

/* Today's special: a small card that floats over the photo */
.special {
  display: none;
}

.special img {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
}

.special-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.special-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--cream);
}

.special-price {
  color: var(--on-dark-muted);
}

@keyframes float {
  50% {
    translate: 0 -10px;
  }
}

/* A little mouse outline with a scrolling dot */
.scroll-cue {
  display: none;
}

@keyframes scroll-dot {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: 0 14px;
  }
}

@media (min-width: 760px) {
  /* The special card floats in the bottom-right corner of the hero */
  .special {
    position: absolute;
    right: max(var(--gutter), calc((100% - var(--container)) / 2));
    bottom: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 300px;
    padding: 14px 20px 14px 14px;
    border: 1px solid rgba(217, 182, 136, 0.3);
    border-radius: 18px;
    background-color: rgba(42, 21, 6, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
    animation:
      fade-up 1.3s var(--ease-out) 1.1s backwards,
      float 6s ease-in-out 2.4s infinite;
  }
}

@media (min-width: 900px) {
  .scroll-cue {
    position: absolute;
    bottom: 28px;
    left: 50%;
    display: block;
    width: 26px;
    height: 40px;
    margin-left: -13px;
    border: 1.5px solid rgba(245, 239, 230, 0.5);
    border-radius: 14px;
    animation: fade-up 1.3s var(--ease-out) 1.4s backwards;
  }

  .scroll-cue span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background-color: var(--amber);
    animation: scroll-dot 2s var(--ease-out) infinite;
  }
}

/* MENU */

.menu-grid {
  display: grid;
  gap: 56px 40px;
}

.menu-photo {
  overflow: hidden;
  margin-bottom: 24px;
  border-radius: var(--radius);
}

.menu-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: scale 1.2s var(--ease-out);
}

.menu-col:hover .menu-photo img {
  scale: 1.04;
}

.menu-col h3 {
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1.5px solid var(--espresso);
  font-size: 1.6rem;
}

.menu-list {
  padding: 0;
  list-style: none;
}

/* Name ........ price, with the description underneath */
.menu-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 2px 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.item-name {
  font-weight: 600;
}

.leader {
  border-bottom: 1.5px dotted rgba(64, 34, 11, 0.3);
  translate: 0 -4px;
}

.item-price {
  font-family: var(--font-display);
  font-weight: 700;
}

.item-desc {
  grid-column: 1 / -1;
  font-size: 0.93rem;
  color: var(--text-muted);
}

/* Today's special gets a soft highlight */
.menu-list .is-special {
  margin-inline: -12px;
  padding-inline: 12px;
  border-radius: 8px;
  border-bottom-color: transparent;
  background-color: var(--cream-2);
}

.menu-note {
  margin-top: 40px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
}

/* OUR STORY */

.story {
  background-color: var(--espresso);
  color: var(--on-dark);
}

.story p {
  color: var(--on-dark-muted);
  font-size: 1.1rem;
}

.story p + p {
  margin-top: 16px;
}

.story-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.story-photo {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.story-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.story-text h2 {
  margin-bottom: 22px;
  color: var(--cream);
}

.story .story-sign {
  margin-top: 24px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--amber);
}

/* PHOTOS */

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gallery-grid figure {
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 1.4s var(--ease-out);
}

.gallery-grid figure:hover img {
  scale: 1.04;
}

/* Phones: two wide photos, two tall ones */
.g-plants,
.g-counter {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.g-cup,
.g-portafilters {
  aspect-ratio: 3 / 4;
}

/* A WORD FROM A REGULAR */

.quote-section {
  padding-top: 0;
}

.quote {
  max-width: 820px;
  margin: 0 auto;
  padding-top: clamp(56px, 8vw, 88px);
  border-top: 1px solid var(--line);
  text-align: center;
}

.quote blockquote p {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--text);
}

.quote figcaption {
  margin-top: 20px;
  color: var(--text-muted);
}

/* VISIT */

.visit {
  background-color: var(--cream-2);
}

.visit-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.visit-text h2 {
  margin-bottom: 18px;
}

.visit-text p {
  max-width: 30em;
  font-size: 1.1rem;
}

.visit-address,
.visit-contact {
  margin-top: 20px;
}

.visit .concept-note {
  margin-top: 24px;
  font-size: 0.88rem;
}

.hours {
  padding: 30px;
  background-color: var(--cream-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* "Open now, until 9pm" (set by script.js) */
.open-now {
  margin: 4px 0 14px;
  font-weight: 600;
  color: var(--text);
}

.open-now.is-open {
  color: #2f7a43;
}

.open-now.is-closed {
  color: #a8442e;
}

.hours-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.hours-list div:last-child {
  border-bottom: 0;
}

.hours-list dt,
.hours-list dd {
  white-space: nowrap;
}

.hours-list dd {
  margin: 0;
  text-align: right;
}

/* script.js marks today's row */
.hours-list .is-today {
  font-weight: 700;
  color: var(--text);
}

.hours-list .is-today dt::after {
  content: " (today)";
  font-weight: 400;
  color: var(--text-muted);
}

/* FOOTER */

.site-footer {
  background-color: var(--espresso-2);
  color: var(--on-dark);
}

.footer-top {
  display: grid;
  gap: 32px;
  padding-block: 56px 40px;
}

.footer-brand p {
  margin-top: 10px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--on-dark-muted);
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a {
  width: fit-content;
  color: var(--on-dark-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--cream);
}

.footer-hours {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--on-dark-muted);
}

.footer-hours li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 220px;
}

.footer-hours span {
  color: var(--cream);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 20px 30px;
  border-top: 1px solid var(--line-dark);
}

.footer-bottom p,
.footer-bottom > a {
  font-size: 0.9rem;
  color: var(--on-dark-muted);
}

.footer-bottom p a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-color: rgba(217, 182, 136, 0.5);
  text-underline-offset: 4px;
}

.footer-bottom > a {
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--amber);
}

/* SCROLL REVEAL (only when JavaScript is on, see script.js) */

.js .reveal,
.js .stagger > * {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 1s var(--ease-out),
    translate 1.2s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-visible,
.js .stagger.is-visible > * {
  opacity: 1;
  translate: 0 0;
}

/* Items in a .stagger group arrive one after another */
.stagger > :nth-child(2) {
  --delay: 0.1s;
}
.stagger > :nth-child(3) {
  --delay: 0.2s;
}
.stagger > :nth-child(4) {
  --delay: 0.3s;
}

/* LARGER SCREENS */

@media (min-width: 860px) {
  .footer-top {
    grid-template-columns: 1.5fr 1fr 1fr;
    align-items: start;
    gap: 48px;
  }
}

@media (min-width: 900px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Photos: two wide on the left, two tall on the right */
  .gallery-grid {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 14px;
  }

  .gallery-grid figure {
    aspect-ratio: auto;
  }

  .g-plants {
    grid-column: 1;
    grid-row: 1;
  }

  .g-counter {
    grid-column: 1;
    grid-row: 2;
  }

  .g-cup {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .g-portafilters {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

@media (min-width: 960px) {
  .story-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 72px;
  }

  .visit-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
  }
}

/* SMALL PHONES */

@media (max-width: 420px) {
  :root {
    --gutter: 18px;
  }

  .actions .dy-btn {
    width: 100%;
  }

  .brand span {
    font-size: 1.8rem;
  }

  .hours {
    padding: 24px 20px;
  }
}

/* RESPECT REDUCED MOTION */

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal,
  .js .stagger > * {
    opacity: 1;
    translate: 0 0;
  }
}
