/* =========================================================
   Los Morcines · Coming soon
   ========================================================= */

/* When the real brand fonts arrive, put the files in assets/fonts/
   and remove the comment marks around these two blocks.
   (Check that the file names match yours.)

@font-face {
  font-family: "Awesome Lathusca";
  src: url("assets/fonts/AwesomeLathusca.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Nourd";
  src: url("assets/fonts/Nourd-Regular.woff2") format("woff2");
  font-display: swap;
}
*/

:root {
  /* Brand palette */
  --burgundy: #421111;
  --cream:    #FAF7F1;
  --sand:     #EEE1BD;
  --taupe:    #AD9D8F;
  --blue:     #A2BBD2;

  /* Deeper taupe for small text, so it stays readable (5:1 on cream) */
  --taupe-ink: #77685B;

  --font-display: "Awesome Lathusca", "Instrument Serif", Georgia, serif;
  --font-text: "Nourd", "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gap: clamp(0.75rem, 2.4svh, 1.5rem);
}

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

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--burgundy);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p { margin: 0; }

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

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

/* ---------- Language toggle ---------- */

.lang {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  z-index: 1;
}

.lang__btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.45rem 0.4rem;
  font: inherit;
  letter-spacing: inherit;
  color: var(--taupe-ink);
  cursor: pointer;
  transition: color 0.2s ease;
}

.lang__btn:hover { color: var(--burgundy); }

.lang__btn[aria-pressed="true"] {
  color: var(--burgundy);
  font-weight: 500;
}

.lang__sep { color: var(--taupe); }

/* ---------- Hero ---------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  padding: 3rem 1.25rem 1rem;
  text-align: center;
}

.logo {
  margin: 0;
  line-height: 1;
}

.logo img {
  display: block;
  width: min(180px, 52vw, 24svh);
  height: auto;
}

.headline {
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.8rem);
  line-height: 1.1;
  text-wrap: balance;
}

/* ---------- The oven (animation block) ---------- */

.oven {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.loaf {
  display: block;
  width: clamp(120px, 19svh, 190px);
  height: auto;
  overflow: visible;
  transform-origin: 50% 100%;
  animation: breathe 4s ease-in-out infinite;
}

.loaf__line {
  fill: none;
  stroke: var(--burgundy);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.2s ease-in-out 0.2s forwards;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.proofing {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  /* Nudge right by half the dots' width so the word itself looks centred */
  padding-left: 1.5ch;
}

.proofing__dots {
  display: inline-block;
  width: 1.5ch;
  text-align: left;
  letter-spacing: 0.1em;
}

.bar {
  display: block;
  width: min(240px, 70vw);
  height: auto;
  overflow: visible;
  animation: tremble 2.6s ease-in-out 3.2s infinite;
}

.bar__fill {
  fill: var(--sand);
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(0.87);
  animation:
    fill 3s cubic-bezier(0.3, 0.6, 0.25, 1) both,
    wiggle 1.8s ease-in-out 3s infinite;
}

.bar__line {
  fill: none;
  stroke: var(--burgundy);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bar__line--ghost {
  stroke-width: 0.8;
  opacity: 0.35;
}

@keyframes fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(0.87); }
}

/* Almost there… but not quite. Never 100%. */
@keyframes wiggle {
  0%, 100% { transform: scaleX(0.87); }
  50%      { transform: scaleX(0.878); }
}

@keyframes tremble {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-0.35deg); }
  75%      { transform: rotate(0.35deg); }
}

.status {
  min-height: 1.5em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--burgundy);
  opacity: 0.85;
  transition: opacity 0.45s ease;
}

.status.is-fading { opacity: 0; }

/* ---------- Description & button ---------- */

.description {
  max-width: 34ch;
  font-size: clamp(0.92rem, 0.85rem + 0.3vw, 1.05rem);
  text-wrap: pretty;
}

em { font-style: italic; }

.description em {
  font-family: var(--font-display);
  font-size: 1.2em;
}

.ig-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  padding: 0.8rem clamp(1rem, 4vw, 1.4rem);
  border-radius: 999px;
  background: var(--burgundy);
  color: var(--cream);
  font-size: clamp(0.8rem, 0.72rem + 0.5vw, 0.92rem);
  line-height: 1.3;
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ig-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgba(66, 17, 17, 0.55);
}

.ig-button:focus-visible {
  outline-offset: 4px;
  border-radius: 999px;
}

.ig-button__icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ig-button__dot { fill: currentColor; stroke: none; }

/* ---------- Footer ---------- */

.footer {
  padding: 0.5rem 1.25rem max(1rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--taupe-ink);
}

.footer em { font-family: var(--font-display); font-size: 1.25em; }

/* ---------- Larger screens ---------- */

@media (min-width: 768px) {
  .logo img { width: min(240px, 26svh); }
  .bar { width: 280px; }
  .status { font-size: 1.25rem; }
  .footer { font-size: 0.8rem; }
}

/* ---------- Short screens: tighten spacing ---------- */

@media (max-height: 700px) {
  .hero { padding-top: 2.5rem; }
  .oven { gap: 0.4rem; }
  .ig-button { padding: 0.7rem 1.2rem; }
}

/* Very short screens (e.g. iPhone SE 1st gen, 320×568) */
@media (max-height: 600px) {
  :root { --gap: 0.6rem; }
  .hero { padding-top: 2rem; padding-bottom: 0.5rem; }
  .logo img { width: min(130px, 22svh); }
  .headline { font-size: 1.55rem; }
  .loaf { width: 96px; }
  .ig-button { padding: 0.6rem 1rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .loaf,
  .loaf__line,
  .bar,
  .bar__fill { animation: none; }
  .loaf__line { stroke-dashoffset: 0; }
  .bar__fill { transform: scaleX(0.87); }
  .status { transition: none; }
  .ig-button { transition: none; }
}
