/* ==========================================================================
   Iyagi — 이야기
   Single-screen landing page: full-bleed photos in a slow crossfade,
   the name at the centre, the story in a few words at the bottom.
   ========================================================================== */

:root {
  --paper: #F5F0E8;   /* hanji */
  --ink:   #0F0E0D;   /* meok */

  --font-serif:  'Cormorant Garamond', 'Times New Roman', serif;
  --font-sans:   'DM Sans', system-ui, -apple-system, sans-serif;
  --font-hangul: 'Noto Serif KR', serif;

  --slides: 5;
  --slide:  6s;                                /* time per photo */
  --cycle:  calc(var(--slides) * var(--slide));
}

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

/* One page: nothing scrolls */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  height: 100svh;
  margin: 0;
  padding: 20px 24px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p, h1 { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--paper);
  color: var(--ink);
}

:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 4px;
}

.hangul {
  font-family: var(--font-hangul);
}


/* --- Language: lang="en" / lang="fr", only the active one is shown -------- */

body.lang-fr [lang="en"],
body:not(.lang-fr) [lang="fr"] {
  display: none !important;
}

.tagline,
.soon,
.about {
  transition: opacity 0.25s ease;
}

body.is-switching-lang .tagline,
body.is-switching-lang .soon,
body.is-switching-lang .about {
  opacity: 0;
}


/* --- Backdrop: CSS-only crossfade ----------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: slide var(--cycle) linear infinite backwards;
}

.backdrop img:nth-child(1) { animation-delay: calc(var(--slide) * 0 - var(--cycle) * 0.06); }
.backdrop img:nth-child(2) { animation-delay: calc(var(--slide) * 1 - var(--cycle) * 0.06); }
.backdrop img:nth-child(3) { animation-delay: calc(var(--slide) * 2 - var(--cycle) * 0.06); }
.backdrop img:nth-child(4) { animation-delay: calc(var(--slide) * 3 - var(--cycle) * 0.06); }
.backdrop img:nth-child(5) { animation-delay: calc(var(--slide) * 4 - var(--cycle) * 0.06); }

/* 5 photos per cycle: each holds 20 %, plus 6 % of crossfade */
@keyframes slide {
  0%   { opacity: 0; transform: scale(1.08); }
  6%   { opacity: 1; }
  20%  { opacity: 1; }
  26%  { opacity: 0; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* Dark veil so the text stays readable */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(15, 14, 13, 0.6) 0%, rgba(15, 14, 13, 0) 38%),
    radial-gradient(ellipse at center, rgba(15, 14, 13, 0.45) 0%, rgba(15, 14, 13, 0.2) 70%),
    rgba(15, 14, 13, 0.25);
}

/* Hanji paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  filter: invert(1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.16 0 0 0 0 0.15 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* --- Language toggle, top right -------------------------------------------- */

.top {
  position: relative;
  z-index: 1;
  justify-self: end;
}

.lang-toggle {
  display: inline-flex;
  gap: 0.45em;
  padding: 8px 0;
  border: 0;
  background: none;
  color: rgba(245, 240, 232, 0.5);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(15, 14, 13, 0.6);
  cursor: pointer;
}

.lang-toggle [data-lang] {
  transition: color 0.3s ease;
}

.lang-toggle:hover [data-lang] {
  color: rgba(245, 240, 232, 0.75);
}

body:not(.lang-fr) .lang-toggle [data-lang="en"],
body.lang-fr .lang-toggle [data-lang="fr"] {
  color: var(--paper);
}


/* --- Name, centred ---------------------------------------------------------- */

.brand {
  position: relative;
  z-index: 1;
  place-self: center;
  text-align: center;
  text-shadow: 0 2px 30px rgba(15, 14, 13, 0.35);
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 2rem + 6vw, 7rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
}

.tagline {
  margin-top: 28px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.92;
  text-shadow: 0 1px 12px rgba(15, 14, 13, 0.6);
}


.soon {
  margin-top: 40px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.7vw, 28px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

/* A short ink stroke between the tagline and "coming soon" */
.soon::before {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  margin: 0 auto 20px;
  background: currentColor;
  opacity: 0.6;
}


/* --- Bottom: what Iyagi is (left), contact (right) ------------------------- */

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  text-shadow: 0 1px 14px rgba(15, 14, 13, 0.55);
}

.about {
  max-width: 30rem;
}

.about__motto {
  margin-bottom: 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
}

.about__text {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.9;
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.contact a {
  opacity: 0.85;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: opacity 0.3s ease, background-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact a:hover,
.contact a:focus-visible {
  opacity: 1;
  background-size: 100% 1px;
}

@media (min-width: 768px) {
  body { padding: 28px 40px 32px; }
  .about { max-width: clamp(30rem, 34vw, 38rem); }
  .about__motto { font-size: clamp(28px, 2.3vw, 40px); }
  .about__text { font-size: clamp(16px, 1.3vw, 21px); }
  .contact { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop img { animation: none; }
  .backdrop img:first-child { opacity: 1; }
}
