/* Phil Kyprianou — shared denim system: tokens, base, seams, nav, labels, footer */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Indigo cloth */
  --indigo-950: #101943;
  --indigo-900: #16225a;
  --indigo-850: #1a2862;
  --indigo-800: #213170;
  --indigo-700: #2c3f88;
  --indigo-600: #3a4f9c;
  --indigo-400: #7387ba;
  --indigo-200: #b6c2de;
  --white-thread: #eef1f7;
  --text-2: #b6c2de;

  /* Thread, metal, leather, labels */
  --thread: #e2a23b;
  --thread-hi: #f3c169;
  --copper: #b9753c;
  --copper-lo: #6e3f19;
  --leather: #b98250;
  --leather-ink: #2a1607;
  --label: #f1ece2;
  --label-shade: #ddd5c6;
  --label-ink: #1c2847;
  --label-ink-2: #46506e;
  --selvedge-red: #c23a2f;
  --selvedge-red-deep: #a8302a; /* holds 5:1 on label stock for small text */

  --font-display: 'Big Shoulders', 'Arial Narrow', sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1240px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-sew: cubic-bezier(0.55, 0, 0.35, 1);

  /* Right-hand twill: fine diagonals plus horizontal slub */
  --twill:
    repeating-linear-gradient(117deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 2.5px, rgba(0,0,0,0.18) 2.5px 3.5px, transparent 3.5px 5px),
    repeating-linear-gradient(0deg, rgba(220,230,255,0.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(0deg, rgba(220,230,255,0.03) 0 1px, transparent 1px 23px);

  --stitch-run: linear-gradient(90deg, var(--thread) 0 58%, transparent 58%);
  --stitch-run-v: linear-gradient(180deg, var(--thread) 0 58%, transparent 58%);
  --stitch-chain: radial-gradient(ellipse 4.6px 2.1px at 50% 50%, var(--thread) 0 62%, transparent 74%);
  --stitch-chain-v: radial-gradient(ellipse 2.1px 4.6px at 50% 50%, var(--thread) 0 62%, transparent 74%);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  scrollbar-color: var(--indigo-600) var(--indigo-950);
  background: var(--indigo-950);
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--white-thread);
  background-color: var(--indigo-900);
  background-image: var(--twill);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--thread); color: var(--indigo-950); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--indigo-950); }
::-webkit-scrollbar-thumb { background: var(--indigo-600); border: 2px solid var(--indigo-950); }

:focus-visible {
  outline: 2px dashed var(--thread);
  outline-offset: 4px;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.25em; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--label);
  color: var(--label-ink);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Seams ---------- */
/* Felled seam: two rows of running stitch over a pressed ridge. Sits between panels of cloth. */
.seam-felled {
  position: relative;
  height: 22px;
  background:
    var(--stitch-run) 0 5px / 11px 2px repeat-x,
    var(--stitch-run) 5px 15px / 11px 2px repeat-x,
    linear-gradient(180deg, transparent 0 9px, rgba(0,0,0,0.38) 9px 10px, rgba(255,255,255,0.06) 10px 12px, transparent 12px);
}

/* Title underline: chain stitch that sews in when reached */
.title {
  display: inline-block;
  position: relative;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 72;
  font-weight: 900;
  font-size: clamp(2.75rem, 6.2vw, 5.5rem);
  line-height: 0.88;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  padding-bottom: 22px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.title::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 0;
  bottom: 0;
  height: 6px;
  background: var(--stitch-chain) 0 0 / 9px 6px repeat-x;
}
.js .title::after { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s var(--ease-sew); }
.js .title.is-sewn::after { clip-path: inset(0 0 0 0); }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background-color: var(--indigo-950);
  background-image: var(--twill);
  transition: box-shadow 0.3s ease;
}
.nav.is-scrolled { box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

/* The yoke seam under the nav; sews across on load */
.yoke {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  overflow: hidden;
  pointer-events: none;
}
.yoke .seam-felled { animation: sewAcross 1.15s 0.1s var(--ease-sew) both; }
.yoke-needle {
  position: absolute;
  inset: 0;
  animation: needle 1.15s 0.1s var(--ease-sew) both;
}
.yoke-needle::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--thread-hi);
  box-shadow: 0 0 0 3px rgba(243,193,105,0.18);
}
@keyframes sewAcross { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes needle {
  0% { transform: translateX(-100%); opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateX(0); opacity: 0; }
}

/* Woven name label */
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  background:
    repeating-linear-gradient(0deg, rgba(28,40,71,0.05) 0 1px, transparent 1px 3px),
    var(--label);
  color: var(--label-ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow: 0 2px 3px rgba(0,0,0,0.35);
}
.brand::before, .brand::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--stitch-run-v) 0 0 / 2px 7px repeat-y;
}
.brand::before { left: 5px; }
.brand::after { right: 5px; }
.brand span { color: var(--selvedge-red); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
}
.nav-links > a:not(.tab) {
  font-stretch: 78%;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-2);
  padding: 6px 0;
  background: var(--stitch-run) 0 100% / 8px 2px repeat-x;
  background-size: 0 2px;
  transition: color 0.2s ease, background-size 0.35s var(--ease-out);
}
.nav-links > a:not(.tab):hover { color: var(--white-thread); background-size: 8px 2px; }

/* Stitched tab: the primary action */
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  background: var(--thread);
  color: var(--indigo-950);
  font-stretch: 80%;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  outline: 1.5px dashed rgba(11,17,34,0.55);
  outline-offset: -6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.35), 0 8px 16px -6px rgba(0,0,0,0.55);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.tab:hover { background: var(--thread-hi); }
.tab:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.tab:focus-visible { outline: 2px dashed var(--white-thread); outline-offset: 4px; }

/* Bilingual care label */
.care {
  display: inline-flex;
  align-items: stretch;
  background:
    repeating-linear-gradient(0deg, rgba(28,40,71,0.05) 0 1px, transparent 1px 3px),
    var(--label);
  box-shadow: 0 2px 3px rgba(0,0,0,0.35);
}
.lang-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 7px 11px;
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--label-ink-2);
  transition: color 0.15s ease;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--label-shade); }
.lang-btn:hover { color: var(--label-ink); }
.lang-btn.active {
  color: var(--label-ink);
  font-weight: 800;
  background: linear-gradient(var(--selvedge-red), var(--selvedge-red)) 50% calc(100% - 4px) / 14px 2px no-repeat;
}
.lang-btn:focus-visible { outline-color: var(--label-ink); outline-offset: -3px; }

.menu-btn {
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 2px;
  font-stretch: 78%;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-thread);
  background: var(--stitch-run) 0 100% / 8px 2px repeat-x;
}

.mobile-tools { display: none; align-items: center; gap: 14px; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 100px var(--gutter) 48px;
  background-color: var(--indigo-950);
  background-image: var(--twill);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.mobile-menu.open { visibility: visible; opacity: 1; transition: opacity 0.3s ease; }
.mobile-menu a:not(.tab) {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white-thread);
}
.mobile-menu a:not(.tab):hover { color: var(--thread); }
.mobile-menu .tab { align-self: flex-start; margin-top: 18px; font-size: 1rem; padding: 15px 26px; }

@keyframes rise { from { transform: translateY(104%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- FOOTER: the selvedge edge ---------- */
.footer {
  position: relative;
  background-color: var(--indigo-950);
  background-image: var(--twill);
}
.selvedge {
  height: 16px;
  background:
    linear-gradient(180deg, transparent 0 7px, var(--selvedge-red) 7px 9px, transparent 9px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 3px),
    var(--label);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 44px 52px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.footer-links a {
  font-stretch: 78%;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-2);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--thread); }
.footer-copy {
  font-stretch: 78%;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--indigo-400);
  font-variant-numeric: tabular-nums;
}

/* ---------- RESPONSIVE (shared) ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .mobile-tools { display: flex; }
  .menu-btn { display: inline-block; }
  .nav-inner { height: 64px; }
}

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .yoke .seam-felled, .yoke-needle { animation: none !important; }
  .yoke-needle { display: none; }
  .js .title::after { clip-path: none !important; transition: none; }
}
