/* =============================================================================
   DIGITALWEBTONICS — main.css
   Design tokens · Reset · Typography · Layout · Utilities
   ============================================================================= */


/* =============================================================================
   1. GOOGLE FONTS IMPORT
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,600;1,700;1,900&family=Inter:wght@300;400;500;600&display=swap');


/* =============================================================================
   2. DESIGN TOKENS — CSS Custom Properties
   ============================================================================= */

:root {

  /* --- Backgrounds --- */
  --bg-primary:       #0A0A0A;
  --bg-secondary:     #101010;
  --bg-elevated:      #1A1A1A;
  --bg-card:          #141414;

  /* --- The one accent — use sparingly (< 15% of visible elements) --- */
  --accent:           #7C5CFC;
  --accent-dim:       rgba(124, 92, 252, 0.12);

  /* --- Text — high contrast, legible without squinting --- */
  --text-primary:     #FFFFFF;
  --text-secondary:   #ADADAD;
  --text-muted:       #6B6B6B;

  /* --- Borders — clearly visible --- */
  --border:           #292929;
  --border-mid:       #3D3D3D;

  /* --- Noise overlay opacity --- */
  --noise-opacity:    0.035;

  /* --- Typography --- */
  --font-display:     'Playfair Display', Georgia, serif;
  --font-body:        'Inter', 'Helvetica Neue', sans-serif;

  /* --- Type scale --- */
  --text-hero:        clamp(2.4rem, 4.2vw, 4.8rem);
  --text-h2:          clamp(2rem, 4vw, 4rem);
  --text-h3:          clamp(1.3rem, 1.8vw, 1.8rem);
  --text-body:        1rem;
  --text-small:       0.925rem;
  --text-label:       0.8rem;

  /* --- Spacing --- */
  --space-section:    clamp(100px, 15vw, 180px);
  --space-gap:        clamp(20px, 3vw, 40px);
  --max-width:        1280px;
  --content-width:    960px;

  /* --- Border radius — almost none --- */
  --radius-card:      2px;
  --radius-btn:       3px;
  --radius-image:     4px;
  --radius-pill:      100px;

  /* --- Shadows — depth without glow --- */
  --shadow-card:      0 1px 0 var(--border), 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-deep:      0 40px 120px rgba(0, 0, 0, 0.7);

  /* --- Transitions --- */
  --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard:    cubic-bezier(0.4, 0, 0.2, 1);
}


/* =============================================================================
   3. RESET & BASE
   ============================================================================= */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Noise texture overlay — covers every page --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
}

svg {
  display: block;
}


/* =============================================================================
   4. TYPOGRAPHY
   ============================================================================= */

/* --- Display / Headlines — Playfair Display --- */
h1,
h2,
h3,
h4,
.display {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1 {
  font-size: var(--text-hero);
  font-style: italic;
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.08;
}

h3 {
  font-size: var(--text-h3);
  font-weight: 600;
}

/* --- Section eyebrow / label --- */
.label {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.label-bracket::before { content: '[ '; }
.label-bracket::after  { content: ' ]'; }

/* --- Body text --- */
p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body);
  line-height: 1.8;
  color: var(--text-secondary);
}

/* --- Small text --- */
.text-small {
  font-size: var(--text-small);
}

/* --- Accent / highlighted word in headline --- */
.accent-word {
  color: var(--accent);
  font-style: italic;
}

/* --- Muted text --- */
.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-primary {
  color: var(--text-primary);
}


/* =============================================================================
   5. LAYOUT
   ============================================================================= */

/* --- Container — full width with max-width guard --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 80px);
}

/* --- Narrower content container --- */
.container--narrow {
  max-width: var(--content-width);
}

/* --- Section wrapper --- */
section {
  padding-block: var(--space-section);
  position: relative;
}

/* --- Section inner (allows margin number in left gutter) --- */
.section-inner {
  position: relative;
  padding-left: clamp(0px, 4vw, 60px);
}

/* --- Section number — left margin counter --- */
.section-number {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  user-select: none;
  pointer-events: none;
  opacity: 0.6;
}

@media (max-width: 767px) {
  .section-number {
    display: none;
  }
}

/* --- Section header block --- */
.section-header {
  margin-bottom: clamp(40px, 6vw, 80px);
}

.section-header .label {
  display: block;
  margin-bottom: 16px;
}

.section-header h2 {
  margin-bottom: 20px;
}

.section-header p {
  max-width: 480px;
  font-size: 1rem;
}

/* --- Grid utilities --- */
.grid {
  display: grid;
  gap: var(--space-gap);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

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

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

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

/* --- Horizontal rule — divider --- */
.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.rule--mid {
  border-top-color: var(--border-mid);
}

.rule--accent {
  border-top-color: var(--accent);
  border-top-width: 1px;
}

/* --- Violet accent line (decorative) --- */
.accent-line {
  display: block;
  width: 0;
  height: 1px;
  background-color: var(--accent);
  margin-top: 12px;
}


/* Custom cursor removed */


/* =============================================================================
   7. NAVIGATION
   ============================================================================= */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 24px 0;
  transition: background 0.4s ease,
              backdrop-filter 0.4s ease,
              padding 0.4s ease,
              border-bottom 0.4s ease;
}

.nav.scrolled {
  background: rgba(7, 7, 7, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* --- Logo --- */
.nav__logo {
  display: flex;
  align-items: center;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-8px);
}

.nav__logo-img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Fallback text logo (used if img fails) */
.nav__logo span {
  color: var(--accent);
}

/* --- Nav links --- */
.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.25s ease;
  opacity: 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

/* --- Nav CTA --- */
.nav__cta {
  opacity: 0;
}

/* --- Hamburger (mobile) --- */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  cursor: pointer;
  padding: 4px;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--text-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Mobile nav overlay --- */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 999;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(40px, 8vw, 100px);
  gap: 12px;
}

.nav__overlay.open {
  display: flex;
}

.nav__overlay-link {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.1;
  opacity: 0;
  transform: translateY(20px);
  transition: color 0.25s ease;
}

.nav__overlay-link:hover {
  color: var(--accent);
}

.nav__overlay-link.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1023px) {
  .nav__links {
    display: none;
  }
  .nav__cta {
    display: none;
  }
  .nav__hamburger {
    display: flex;
  }
}


/* =============================================================================
   8. BUTTONS
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.88;
}

/* Primary — violet fill */
.btn--primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

/* Ghost — transparent with border */
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-mid);
}

.btn--ghost:hover {
  border-color: var(--text-muted);
  opacity: 1;
}

/* Small variant */
.btn--sm {
  padding: 10px 20px;
  font-size: 0.7rem;
}

/* Button row */
.btn-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}


/* =============================================================================
   9. SECTION DECORATIVE ELEMENTS
   ============================================================================= */

/* --- Horizontal section divider with section label --- */
.section-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.section-meta__num {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.section-meta__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* =============================================================================
   10. SCROLL REVEAL — Base states
   ============================================================================= */

/* Initial hidden state — JS adds .visible to trigger transition */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--ease-out-expo),
              transform 0.9s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--ease-out-expo),
              transform 0.9s var(--ease-out-expo);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 400ms; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* =============================================================================
   11. FOCUS STYLES — Accessibility
   ============================================================================= */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}


/* =============================================================================
   12. SELECTION
   ============================================================================= */

::selection {
  background: var(--accent-dim);
  color: var(--text-primary);
}


/* =============================================================================
   13. SCROLLBAR — Minimal, matching palette
   ============================================================================= */

::-webkit-scrollbar {
  width: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* =============================================================================
   14. UTILITY CLASSES
   ============================================================================= */

.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;
}

.relative  { position: relative; }
.overflow-h { overflow: hidden; }

.mt-sm  { margin-top: 12px; }
.mt-md  { margin-top: 24px; }
.mt-lg  { margin-top: 40px; }
.mt-xl  { margin-top: 64px; }

.mb-sm  { margin-bottom: 12px; }
.mb-md  { margin-bottom: 24px; }
.mb-lg  { margin-bottom: 40px; }

.pt-0   { padding-top: 0 !important; }
.pb-0   { padding-bottom: 0 !important; }

.w-full { width: 100%; }
