/* =========================================================================
   MRINGCO Base Styles — Reset, Typography, Elements
   ========================================================================= */

/* --- Reset & Box Model --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-black);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Skip to content (accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  background: var(--color-yellow);
  color: var(--color-black);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.skip-link:focus {
  top: var(--space-4);
}

/* --- Selection --- */
::selection {
  background: var(--color-yellow);
  color: var(--color-black);
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface-1); }
::-webkit-scrollbar-thumb { background: var(--color-surface-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-yellow); }

/* =========================================================================
   Typography
   ========================================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); font-family: var(--font-ui); font-weight: 700; }
h6 { font-size: var(--text-md); font-family: var(--font-ui); font-weight: 600; }

p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-secondary);
}
p + p { margin-top: var(--space-4); }

a {
  color: var(--color-yellow);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--color-yellow-light); }
a:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

strong, b { font-weight: 600; color: var(--color-text-primary); }
em, i     { font-style: italic; }

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  background: var(--color-surface-3);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-yellow);
}
pre {
  background: var(--color-surface-2);
  padding: var(--space-4);
  border-left: var(--border-accent);
  overflow-x: auto;
  white-space: pre-wrap;
}

small { font-size: var(--text-xs); }

hr {
  border: none;
  border-top: var(--border-thin);
  margin: var(--space-8) 0;
}

blockquote {
  border-left: var(--border-accent);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface-2);
  font-style: italic;
  color: var(--color-text-secondary);
}

ul, ol {
  padding-left: var(--space-6);
  color: var(--color-text-secondary);
}
li { margin-bottom: var(--space-2); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
th {
  font-family: var(--font-ui);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  text-align: left;
  border-bottom: var(--border-thin);
}
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-thin);
  color: var(--color-text-secondary);
}
tr:nth-child(even) td { background: var(--color-surface-1); }
tr:last-child td { border-bottom: none; }

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

figure { margin: 0; }

/* =========================================================================
   Layout Utilities
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.container--wide   { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section {
  padding-block: var(--space-20);
}
.section--lg { padding-block: var(--space-32); }
.section--sm { padding-block: var(--space-12); }

/* --- Grid helpers --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* --- Flex helpers --- */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-2   { gap: var(--space-2); }
.flex-gap-4   { gap: var(--space-4); }
.flex-gap-6   { gap: var(--space-6); }

/* --- Text utilities --- */
.text-yellow    { color: var(--color-yellow); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-mono      { font-family: var(--font-mono); }
.text-ui        { font-family: var(--font-ui); }
.text-display   { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; }
.text-upper     { text-transform: uppercase; letter-spacing: 0.08em; }
.text-center    { text-align: center; }

/* --- Visibility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.hidden { display: none !important; }

/* --- Section labels (overline text) --- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-yellow);
  margin-bottom: var(--space-3);
}
.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-yellow);
  flex-shrink: 0;
}

/* --- Section heading with wipe underline (JS adds active class) --- */
.section-heading {
  position: relative;
  display: inline-block;
}
.section-heading__line {
  position: absolute;
  bottom: -8px;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--color-yellow);
  transition: width var(--duration-slow) var(--ease-out);
}
.section-heading.is-visible .section-heading__line {
  width: 100%;
}

/* --- Caution stripe decorative element --- */
.caution-stripe {
  height: 4px;
  background: var(--caution-stripe);
}

/* --- Noise overlay --- */
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--noise-overlay);
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* --- GSAP initial states (hidden before animation) --- */
.gsap-fade-up {
  opacity: 0;
  transform: translateY(40px);
}
.gsap-fade-in {
  opacity: 0;
}
.gsap-slide-left {
  opacity: 0;
  transform: translateX(-40px);
}
.gsap-slide-right {
  opacity: 0;
  transform: translateX(40px);
}

/* --- WooCommerce notice base --- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
}
.woocommerce-message {
  background: rgba(46,204,113,0.1);
  border-left: 3px solid var(--color-success);
  color: var(--color-success);
}
.woocommerce-info {
  background: rgba(52,152,219,0.1);
  border-left: 3px solid var(--color-info);
  color: var(--color-info);
}
.woocommerce-error {
  background: rgba(231,76,60,0.1);
  border-left: 3px solid var(--color-error);
  color: var(--color-error);
}
.woocommerce-error li { list-style: none; margin: 0; }

/* WooCommerce message with button */
.woocommerce-message .button,
.woocommerce-info .button {
  margin-left: auto;
  flex-shrink: 0;
}

/* --- WooCommerce notices (flash) reset --- */
.woocommerce-notices-wrapper { width: 100%; }

/* =========================================================================
   404 Page
   ========================================================================= */

.error-404-main {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: var(--space-20) 0;
}

.error-404-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  width: 100%;
}

.error-404__number {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(8rem, 20vw, 18rem);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  user-select: none;
}
.error-404__4 { color: var(--color-yellow); }
.error-404__0 { color: var(--color-text-primary); }
.error-404__0 svg {
  width: 0.7em;
  height: 0.7em;
  color: var(--color-surface-4);
}

.error-404__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.error-404__title {
  font-size: var(--text-3xl);
  color: var(--color-text-primary);
}
.error-404__desc {
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  max-width: 440px;
}

.error-404__search-label {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.error-404__search-form { max-width: 420px; }

.error-404__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.error-404__stripe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -40px;
  height: 6px;
  background: var(--caution-stripe);
}

@media (max-width: 768px) {
  .error-404-inner { grid-template-columns: 1fr; text-align: center; }
  .error-404__number { justify-content: center; }
  .error-404__copy { align-items: center; }
  .error-404__search-form { width: 100%; }
  .error-404__actions { justify-content: center; }
}
