/* Loom & Leaf Fashion - first page.
   Colours from the registered logo (forest green, leaf green, gold, the cream of its ground);
   the phone's or computer's own fonts only. */

:root {
  --cream: #F1EDE1;         /* the logo's ground */
  --forest: #2A482A;        /* the L */
  --leaf: #8A9660;          /* the leaves */
  --gold: #B89858;          /* the thread - lines and accents */
  --gold-text: #846030;     /* the thread, dark enough to read as small text */
  --ink: #2B3A28;           /* body text */

  --serif: "Sitka Banner", "Sitka Display", Baskerville, "Iowan Old Style", "Palatino Linotype", "Noto Serif", Georgia, serif;
  --sans: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --thai: "Leelawadee UI", "Noto Sans Thai", "Sukhumvit Set", Thonburi, Tahoma, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

/* Thai needs room above and below the line for its marks */
:lang(th) {
  font-family: var(--thai);
  line-height: 1.7;
}

/* ---------- language switch ---------- */

.top {
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem var(--gutter) 0;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(42, 72, 42, 0.08);
}

.lang-switch a {
  display: block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  color: var(--forest);
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
}

.lang-switch a[lang="en"] { font-family: var(--sans); }

.lang-switch a:hover { background: rgba(42, 72, 42, 0.08); }

.lang-switch a[aria-current="page"] {
  background: var(--forest);
  color: var(--cream);
}

.lang-switch a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(1.5rem, 5vh, 4rem) var(--gutter);
}

.brand { text-align: center; }

/* the lockup, laid out like the registered artwork */
.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* the registered sign sits where the artwork's corner mark was */
.mark-wrap {
  position: relative;
  display: block;
  margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
}

.reg {
  position: absolute;
  top: 0;
  right: -0.2em;
  font-family: var(--sans);
  font-size: clamp(0.85rem, 1.5vw, 1.15rem);
  line-height: 1;
  color: var(--forest);
}

.mark {
  display: block;
  width: auto;
  height: clamp(7.5rem, 17vw, 12.5rem);
}

/* the name, set as text in the style of the registered lockup (medium serif, wide round letters) */
.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 7.2vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: var(--forest);
}

.motto {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: clamp(0.9rem, 2vw, 1.4rem) 0 0;
  font-size: clamp(0.78rem, 1.15vw, 0.95rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* the gold rules either side, as in the artwork */
.motto::before,
.motto::after {
  content: "";
  width: clamp(1.75rem, 4vw, 3rem);
  height: 1px;
  background: var(--gold);
}

.line {
  margin: 0.7rem 0 0;
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.about {
  margin-top: clamp(2rem, 5vh, 3.25rem);
}

.tagline {
  margin: 0 0 0.35rem;
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  color: var(--forest);
}

html[lang="en"] .tagline { font-family: var(--serif); font-size: clamp(1.2rem, 1.9vw, 1.45rem); }

.status {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

/* ---------- the woven swatch ---------- */

.swatch {
  margin: 0;
  justify-self: center;
  width: min(100%, 24rem);
}

.swatch-cloth {
  aspect-ratio: 3 / 4;
  width: 100%;
  /* until the weave is drawn (or without scripts): a plain cloth look */
  background:
    repeating-linear-gradient(90deg, rgba(241, 237, 225, 0.2) 0 2px, transparent 2px 10px),
    var(--forest);
}

.swatch-cloth.woven { background: none; }

.swatch-cloth svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 24px rgba(42, 72, 42, 0.2));
}

/* one moment: each weft thread is thrown across, top to bottom */
.weft-row {
  transform-box: fill-box;
  transform-origin: left center;
  animation: throw 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 22ms);
}

@keyframes throw {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .weft-row { animation: none; }
}

/* ---------- footer ---------- */

.bottom {
  padding: 0 var(--gutter) 1.5rem;
  font-size: 0.875rem;
  color: var(--ink);
}

.bottom p { margin: 0; }

/* ---------- phones ---------- */

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    align-content: start;
    gap: 2.5rem;
  }

  .swatch {
    justify-self: stretch;
    width: 100%;
  }

  .swatch-cloth { aspect-ratio: 16 / 9; }
}

@media (max-width: 400px) {
  .motto { gap: 0.6rem; letter-spacing: 0.12em; }
  .motto::before,
  .motto::after { width: 1.1rem; }
}
