/* ==========================================================================
   RAGE CLOTHING CULTURE — LINK PORTAL STYLESHEET
   Mobile-First • Streetwear & Thrift-Store Minimal Aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. COLOUR PALETTE
   Strictly two CSS custom properties as defined by brand guidelines.
   No other colour variables or hardcoded colours are used.
   -------------------------------------------------------------------------- */
:root {
  --color-bg: #101010;   /* Warm ecru / parchment paper background */
  --color-text: #ededec; /* Washed slate / charcoal typography & ink */
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY & FONT DECLARATION
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Code Pro Black';
  src: url('../assets/fonts/code_pro_black.woff2') format('woff2'),
       url('../assets/fonts/code_pro_black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   3. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.45;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  position: relative;
}

/* --------------------------------------------------------------------------
   3.5. PRELOADER & INITIAL BRAND LOADING ANIMATION
   Strictly adheres to brand colors (--color-bg, --color-text).
   Eliminates FOUC on initial page load and provides street-luxe entry.
   -------------------------------------------------------------------------- */
.preloader-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-bg);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.preloader-inner {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 2.25rem 1.5rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

/* Industrial Corner Crosshairs */
.preloader-crosshair {
  position: absolute;
  font-family: 'Space Grotesk', monospace, sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1;
  color: var(--color-text);
  opacity: 0.3;
  user-select: none;
  pointer-events: none;
}
.preloader-crosshair-tl { top: 4px; left: 4px; }
.preloader-crosshair-tr { top: 4px; right: 4px; }
.preloader-crosshair-bl { bottom: 4px; left: 4px; }
.preloader-crosshair-br { bottom: 4px; right: 4px; }

/* Centered Brand Logo */
.preloader-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 0.75rem;
}

.preloader-logo-img {
  display: block;
  width: clamp(190px, 52vw, 240px);
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
  animation: preloaderLogoBreathe 2.2s ease-in-out infinite;
  transform-origin: center center;
  will-change: transform;
}

@keyframes preloaderLogoBreathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
}

/* Spec Label Under Logo */
.preloader-spec {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', monospace, sans-serif;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text);
  opacity: 0.65;
  margin-bottom: 1.5rem;
}

.spec-divider {
  opacity: 0.35;
}

/* Progress Track & Fill */
.preloader-meter {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 0.65rem auto;
}

.preloader-track {
  width: 100%;
  height: 2px;
  background-color: rgba(237, 237, 236, 0.14);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.preloader-fill {
  width: 0%;
  height: 100%;
  background-color: var(--color-text);
  border-radius: 1px;
  will-change: width;
  transition: width 0.08s ease-out;
}

/* Status & Numeric Counter */
.preloader-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 200px;
  font-family: 'Space Grotesk', monospace, sans-serif;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  opacity: 0.85;
}

.preloader-status-text {
  text-align: left;
}

.preloader-percent-text {
  text-align: right;
  min-width: 32px;
}

/* Loaded State Classes */
body.loaded #rage-preloader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. LAYOUT CONTAINER (Mobile-First 360-430px, fits 100vh with no scrolls)
   Initially hidden until preloader dismisses to guarantee zero FOUC.
   -------------------------------------------------------------------------- */
.page-wrapper {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
}

body.loaded .page-wrapper {
  opacity: 1;
  visibility: visible;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

/* --------------------------------------------------------------------------
   5. HEADER & WORDMARK
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   5. HEADER & WORDMARK (Centered)
   -------------------------------------------------------------------------- */
.brand-header {
  text-align: center;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
  position: relative;
}

/* Garment hang rail motif */
.hang-rail {
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hang-rail::before,
.hang-rail::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-text);
  position: absolute;
  top: -2px;
}

.hang-rail::before { left: 0; }
.hang-rail::after { right: 0; }

/* Centered Brand Wordmark / SVG Logo */
.wordmark-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.brand-logo-img {
  display: block;
  width: clamp(210px, 58vw, 260px);
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.brand-logo-img:hover {
  transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   6. HANG TAG LINKS LIST
   -------------------------------------------------------------------------- */
.links-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0.25rem;
  margin-bottom: 0.5rem;
  position: relative;
  min-height: 0;
}

.links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: clamp(2.6rem, 6.2vh, 4.5rem);
}

/* Individual Hang Tag Link */
.hang-tag-item {
  position: relative;
}

/* Hanging string extending from top */
.hang-string {
  position: absolute;
  top: clamp(-36px, -5.5vh, -52px);
  left: 20px;
  width: 1.5px;
  height: clamp(38px, 6vh, 54px);
  background-color: var(--color-text);
  z-index: 1;
}

.hang-tag-item:first-child .hang-string {
  top: -20px;
  height: 22px;
}

.hang-tag {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 64px;
  padding: 0.75rem 1rem 0.75rem 3.25rem;
  text-decoration: none;
  color: var(--color-text);
  background-color: var(--color-bg);
  cursor: pointer;
  outline: none;
  transform-origin: 20px 50%;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.2s ease,
              color 0.2s ease;
  will-change: transform;
}

/* Tilts for each clothing tag hung on rail */
.hang-tag-item:nth-child(1) .hang-tag {
  transform: rotate(-1.5deg);
}

.hang-tag-item:nth-child(2) .hang-tag {
  transform: rotate(1.2deg);
}

.hang-tag-item:nth-child(3) .hang-tag {
  transform: rotate(-0.8deg);
}

/* SVG Tag Shape Background */
.tag-svg-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.tag-path {
  fill: var(--color-bg);
  stroke: var(--color-text);
  stroke-width: 1.75;
  vector-effect: non-scaling-stroke;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

/* Punched Eyelet Hole & Grommet */
.tag-eyelet {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.75px solid var(--color-text);
  background-color: var(--color-bg);
  z-index: 2;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tag-eyelet::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background-color: var(--color-bg);
  border: 1px dashed var(--color-text);
}

/* Content Inside Hang Tag */
.tag-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}

.tag-serial {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.85;
}

.tag-title {
  font-family: 'Code Pro Black', 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: inherit;
}

.tag-desc {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.3;
  color: inherit;
}

.tag-action-icon {
  position: relative;
  z-index: 2;
  margin-left: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: inherit;
  transition: transform 0.25s ease;
}

.tag-action-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   7. INTERACTIVE FEEDBACK (Hover, Active, Focus)
   Straightening, shift, and tactile contrast inversion
   -------------------------------------------------------------------------- */
.hang-tag:hover,
.hang-tag:focus-visible {
  transform: rotate(0deg) translateX(4px) !important;
  color: var(--color-bg);
}

.hang-tag:hover .tag-path,
.hang-tag:focus-visible .tag-path {
  fill: var(--color-text);
  stroke: var(--color-text);
}

.hang-tag:hover .tag-eyelet,
.hang-tag:focus-visible .tag-eyelet {
  border-color: var(--color-bg);
  background-color: var(--color-text);
}

.hang-tag:hover .tag-eyelet::after,
.hang-tag:focus-visible .tag-eyelet::after {
  background-color: var(--color-text);
  border-color: var(--color-bg);
}

.hang-tag:hover .tag-action-icon,
.hang-tag:focus-visible .tag-action-icon {
  transform: translate(2px, -2px);
}

.hang-tag:active {
  transform: rotate(0deg) scale(0.98) translateX(2px) !important;
}

/* Visible Keyboard Focus */
.hang-tag:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   8. BRAND STRIP (Marquee & Scroll-driven Moment)
   -------------------------------------------------------------------------- */
.brand-strip-section {
  margin-top: auto;
  margin-bottom: clamp(1rem, 2.6vh, 2rem);
  flex-shrink: 0;
  position: relative;
}

.marquee-container {
  overflow: hidden;
  width: calc(100% + 2.5rem);
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  border-top: 1.5px solid var(--color-text);
  border-bottom: 1.5px solid var(--color-text);
  padding: 0.45rem 0;
  background-color: var(--color-bg);
  white-space: nowrap;
  display: flex;
}

.marquee-track {
  display: flex;
  gap: 1.5rem;
  will-change: transform;
}

.marquee-item {
  font-family: 'Code Pro Black', 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}

.marquee-separator {
  display: inline-block;
  width: 5px;
  height: 5px;
  background-color: var(--color-text);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   9. GARMENT SPEC & CARE LABEL (Authentic Streetwear Spec Tag)
   -------------------------------------------------------------------------- */
.garment-spec-footer {
  margin-top: 0;
  flex-shrink: 0;
  width: 100%;
}

.care-label-card {
  border: 1px solid var(--color-text);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: relative;
  box-sizing: border-box;
}

.care-label-card::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 8px;
  right: 8px;
  height: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--color-text),
    var(--color-text) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.45;
}

.care-barcode-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  flex-shrink: 0;
}

.barcode-svg {
  width: 110px;
  height: 18px;
  color: var(--color-text);
  display: block;
}

.barcode-serial {
  font-family: 'Space Grotesk', monospace, sans-serif;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text);
  text-transform: uppercase;
}

.care-stitch-divider {
  width: 1px;
  height: 26px;
  background-color: var(--color-text);
  opacity: 0.35;
  flex-shrink: 0;
}

.care-specs-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-grow: 1;
}

.care-symbols {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-text);
}

.care-symbol {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.care-symbol:hover {
  opacity: 1;
  transform: scale(1.15);
}

.care-tech-specs {
  font-family: 'Space Grotesk', monospace, sans-serif;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   11. PREFERS-REDUCED-MOTION
   Disables Lenis, load sequence, swing, and continuous marquee
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  #rage-preloader {
    display: none !important;
  }

  .page-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
  }

  .hang-tag-item:nth-child(1) .hang-tag,
  .hang-tag-item:nth-child(2) .hang-tag,
  .hang-tag-item:nth-child(3) .hang-tag {
    transform: none !important;
  }

  .marquee-track {
    animation: none !important;
    transform: none !important;
  }
}
