/* ==========================================================================
   ALUK ALUMINIUM FABRICATION WORKS — CORE DESIGN SYSTEM
   Modern Luxury Architectural & Precision Aluminium Brand
   Multi-Language Ready (English | தமிழ் | മലയാളം)
   ========================================================================== */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&family=Noto+Sans+Tamil:wght@400;500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Space+Grotesk:wght@300;400;500;600;700&family=Syne:wght@500;600;700;800&display=swap');

/* --- Design Tokens & Custom Properties --- */
:root {
  /* Color System - Dark Architectural Luxury */
  --bg-dark: #090a0d;
  --bg-surface-1: #101217;
  --bg-surface-2: #171a21;
  --bg-surface-3: #20242e;
  --bg-glass: rgba(16, 18, 23, 0.72);
  --bg-glass-card: rgba(23, 26, 33, 0.65);
  --bg-glass-elevated: rgba(32, 36, 46, 0.85);

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(226, 230, 235, 0.45);
  --border-metallic: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(161,166,180,0.1) 50%, rgba(226,230,235,0.3) 100%);

  /* Text & Accents */
  --text-primary: #f8f9fa;
  --text-secondary: #a1a6b4;
  --text-muted: #6b7280;
  --text-inverse: #090a0d;

  /* Metallic Aluminium Palette */
  --metal-silver: #e2e6eb;
  --metal-chrome: #c8ccd4;
  --metal-titanium: #8b92a0;
  --metal-sheen: linear-gradient(135deg, #ffffff 0%, #a1a6b4 40%, #e2e6eb 70%, #888e9d 100%);
  
  /* Warm Architectural Accent */
  --accent-gold: #c5a059;
  --accent-gold-hover: #d8b26e;
  --accent-gold-glow: rgba(197, 160, 89, 0.25);
  --accent-blue: #3b82f6;

  /* Typography with Full Tamil & Malayalam Unicode Fallback */
  --font-heading: 'Space Grotesk', 'Noto Sans Tamil', 'Noto Sans Malayalam', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Syne', 'Noto Sans Tamil', 'Noto Sans Malayalam', var(--font-heading);
  --font-body: 'Plus Jakarta Sans', 'Noto Sans Tamil', 'Noto Sans Malayalam', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing Scale */
  --space-2xs: 0.25rem;  /* 4px */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 0.75rem;   /* 12px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4.5rem;   /* 72px */
  --space-4xl: 6rem;     /* 96px */
  --space-5xl: 8rem;     /* 128px */

  /* Section Spacing */
  --section-pad-y: clamp(4.5rem, 8vw, 8.5rem);
  --container-max-w: 1360px;
  --container-pad-x: clamp(1.25rem, 4vw, 3rem);

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions & Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-med: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.7s cubic-bezier(0.16, 1, 0.3, 1);

  /* Elevation Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 30px rgba(226, 230, 235, 0.12);
  --shadow-accent-glow: 0 0 40px rgba(197, 160, 89, 0.22);
}

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

html {
  font-size: 16px;
  scroll-behavior: auto; /* Handled smoothly by Lenis */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  color-scheme: dark;
}

/* Language Switch Smooth Fade Transition */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
  background-color: var(--bg-dark);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: opacity 0.25s var(--ease-out-expo);
}

body.lang-fade {
  opacity: 0.75;
}

body.no-scroll {
  overflow: hidden !important;
}

/* --- Language Specific Typography Adjustments --- */
html[lang="ta"] body,
html[lang="ml"] body {
  line-height: 1.75;
}

html[lang="ta"] h1,
html[lang="ml"] h1 {
  line-height: 1.2;
}

html[lang="ta"] h2,
html[lang="ml"] h2 {
  line-height: 1.25;
}

/* --- Selection --- */
::selection {
  background: var(--metal-silver);
  color: var(--bg-dark);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.3rem, 5.5vw + 0.8rem, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.85rem, 3.8vw + 0.4rem, 3.5rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h3 {
  font-size: clamp(1.3rem, 2.3vw, 2.15rem);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

h4 {
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 600;
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-weight: 400;
}

p:last-child {
  margin-bottom: 0;
}

p.lead {
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  line-height: 1.65;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* --- Container & Layout Helpers --- */
.container {
  width: 100%;
  max-width: var(--container-max-w);
  margin-inline: auto;
  padding-inline: var(--container-pad-x);
}

.container-narrow {
  max-width: 1040px;
}

.container-wide {
  max-width: 1520px;
}

.section {
  position: relative;
  padding-block: var(--section-pad-y);
  z-index: 2;
}

.section-dark {
  background-color: var(--bg-surface-1);
}

.section-darker {
  background-color: var(--bg-dark);
}

.section-divider {
  height: 1px;
  background: var(--border-subtle);
  width: 100%;
  max-width: var(--container-max-w);
  margin-inline: auto;
}

/* --- Section Headers --- */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  margin-bottom: var(--space-md);
  padding: 0.35rem 0.85rem;
  background: rgba(197, 160, 89, 0.08);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: var(--radius-full);
}

.section-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.section-tag-silver {
  color: var(--metal-silver);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
}

.section-tag-silver::before {
  background-color: var(--metal-silver);
  box-shadow: 0 0 8px var(--metal-silver);
}

.section-header {
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-header.text-center {
  text-align: center;
  margin-inline: auto;
  max-width: 860px;
}

.section-header .section-tag {
  margin-inline: auto;
}

.section-title {
  margin-top: var(--space-xs);
  margin-bottom: var(--space-md);
}

.section-desc {
  font-size: clamp(1.05rem, 1.25vw, 1.2rem);
  max-width: 720px;
  color: var(--text-secondary);
}

.text-gradient {
  background: var(--metal-sheen);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gold {
  color: var(--accent-gold);
}

/* --- Grid Systems --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
}

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

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

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-3);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--metal-titanium);
}

/* --- Custom Cursor on Desktop --- */
@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(226, 230, 235, 0.45);
    background: rgba(226, 230, 235, 0.05);
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease-out-expo),
                height 0.3s var(--ease-out-expo),
                background-color 0.3s var(--ease-out-expo),
                border-color 0.3s var(--ease-out-expo),
                transform 0.1s linear;
    mix-blend-mode: difference;
  }

  .custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--metal-silver);
    pointer-events: none;
    z-index: 100000;
    transform: translate(-50%, -50%);
  }

  .custom-cursor.active {
    width: 64px;
    height: 64px;
    background: rgba(226, 230, 235, 0.18);
    border-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: invert(0.1);
  }

  .custom-cursor.view-cursor {
    width: 80px;
    height: 80px;
    background: rgba(197, 160, 89, 0.9);
    border-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .custom-cursor.view-cursor::after {
    content: 'VIEW';
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--bg-dark);
  }
}

@media (hover: none) or (pointer: coarse) {
  .custom-cursor, .custom-cursor-dot {
    display: none !important;
  }
}
