/* ============================================================
   IQRAM AHMED PORTFOLIO — global.css
   Reset, base typography, body, utilities, shared components
   ============================================================ */

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

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

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

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

ul,
ol {
  list-style: none;
}

/* ----------------------------------------------------------
   SITE MAX WIDTH WRAPPER
   Constrains layout to 1600px on wide and ultra-wide monitors.
   Dark background fills beyond that — intentional on dark themes.
   Nav is fixed so handled separately below.
---------------------------------------------------------- */
.site-main {
  max-width: var(--site-max-width);
  margin-left: auto;
  margin-right: auto;
}

.site-footer {
  max-width: var(--site-max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Fixed nav — constrained via left/transform instead of margin */
.site-nav {
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--site-max-width);
}


/* ----------------------------------------------------------
   TYPOGRAPHY BASE
---------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text-tertiary);
}


/* ----------------------------------------------------------
   LAYOUT UTILITIES
---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

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

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


/* ----------------------------------------------------------
   SECTION LABEL
   Small uppercase tracking label above sections.
   Used across all pages — must stay in global.
---------------------------------------------------------- */
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  display: block;
}


/* ----------------------------------------------------------
   BUTTONS
---------------------------------------------------------- */
.btn-outline {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  border: 1px solid var(--color-accent-subtle);
  padding: 10px 22px;
  border-radius: var(--radius-md);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: border-color var(--transition-base), background var(--transition-base);
  white-space: nowrap;
}

.btn-outline:hover {
  border-color: var(--color-accent-muted);
  background: var(--color-accent-deep);
}

.btn-soft {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition-base);
  white-space: nowrap;
}

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

.link-accent {
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity var(--transition-fast);
}

.link-accent:hover {
  opacity: 0.75;
}


/* ----------------------------------------------------------
   CONTACT STRIP
   Shared component used on every page — about, case studies,
   single case study, and homepage all use .contact-strip.
   Defined here in global so it works regardless of which
   page CSS file is loaded. home.css has its own copy too
   for homepage-only overrides if needed.
---------------------------------------------------------- */
.contact-strip {
  padding: var(--space-7) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  border-bottom: var(--border-default);
  background: var(--color-bg-secondary);
}

.contact-strip__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.contact-strip__headline {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 300;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-snug);
  line-height: 1.3;
}

.contact-strip__headline em {
  font-style: italic;
  color: var(--color-accent);
}

.contact-strip__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.contact-strip__email {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition-base);
}

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

.contact-strip__linkedin {
  color: var(--color-text-tertiary);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--transition-base);
}

.contact-strip__linkedin:hover {
  color: var(--color-accent);
}


/* ----------------------------------------------------------
   FOCUS VISIBLE
   Keyboard focus ring using accent colour.
   Suppressed on mouse/touch via :not(:focus-visible).
---------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}


/* ----------------------------------------------------------
   NOISE TEXTURE UTILITY
   Add class="noise" to any section for subtle grain.
   Uses an inline SVG feTurbulence — zero external requests.
   Opacity intentionally very low (0.035) — felt, not seen.
   The element must have position: relative (class handles it).
   Direct children get z-index: 1 to sit above the grain layer.
---------------------------------------------------------- */
.noise {
  position: relative;
}

.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

.noise > * {
  position: relative;
  z-index: 1;
}


/* ----------------------------------------------------------
   SCROLL FADE IN — JS adds .is-visible
   --delay is set per-element by main.js for stagger
---------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--transition-slow) var(--delay, 0ms),
    transform var(--transition-slow) var(--delay, 0ms);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ----------------------------------------------------------
   SELECTION
---------------------------------------------------------- */
::selection {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}


/* ----------------------------------------------------------
   SCROLLBAR
---------------------------------------------------------- */
::-webkit-scrollbar {
  width: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-border-mid);
  border-radius: var(--radius-full);
}


/* ----------------------------------------------------------
   RESPONSIVE — TABLET (1024px)
---------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --text-hero: 3.5rem;
  }
}


/* ----------------------------------------------------------
   RESPONSIVE — MOBILE (768px)
   High DPI phones: iPhone 15 Pro (393px), S22 Ultra (412px).
   At 3x DPI on OLED the eye sits close — generous line height
   and minimum 1rem body size compensate for contrast loss.
---------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --text-hero: 2.625rem;
    --text-4xl: 2.25rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --text-xl: 1.25rem;
  }

  body {
    font-size: 1rem;
    line-height: 1.75;
  }

  p {
    font-size: 1rem;
    line-height: 1.75;
  }

  /* Contact strip — mobile */
  .contact-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-3);
  }

  .contact-strip__headline {
    font-size: 1.5rem;
  }

  .contact-strip__right {
    align-items: flex-start;
  }
}


/* ----------------------------------------------------------
   RESPONSIVE — SMALL MOBILE (430px)
   Covers iPhone 15 Pro (393px) and Android flagships.
---------------------------------------------------------- */
@media (max-width: 430px) {
  :root {
    --text-hero: 2.25rem;
    --text-4xl: 2rem;
  }

  .contact-strip__headline {
    font-size: 1.375rem;
  }
}