/* ============================================================
   HASMAN ENTERPRISE SOLUTIONS — assets/css/base.css
   Reset, typography defaults, utility classes
   ============================================================ */

/* ── @font-face (self-hosted woff2) ────────────────────────── */
@font-face {
  font-family: 'Playfair Display';
  src: url('/assets/fonts/playfair-display-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('/assets/fonts/playfair-display-700i.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('/assets/fonts/raleway-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('/assets/fonts/raleway-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--text-body);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

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

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

ul, ol { list-style: none; }

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

input, textarea, select {
  font: inherit;
  color: inherit;
}

fieldset { border: none; }

table { border-collapse: collapse; }

/* ── Typography Base ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-tight);
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-family: var(--font-display); font-size: var(--text-hero); }
h2 { font-family: var(--font-heading); font-size: var(--text-3xl); }
h3 { font-family: var(--font-heading); font-size: var(--text-xl); }
h4 { font-family: var(--font-heading); font-size: var(--text-lg); font-weight: 600; }
h5 { font-family: var(--font-body); font-size: var(--text-base); font-weight: 600; }

p { margin-bottom: 0; }
p + p { margin-top: var(--sp-4); }

strong { font-weight: 600; }
em { font-style: italic; }

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ── Focus visible ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Selection ──────────────────────────────────────────────── */
::selection {
  background: rgba(0, 176, 240, 0.25);
  color: var(--color-navy);
}

/* ── Scrollbar (Webkit) ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-offwhite); }
::-webkit-scrollbar-thumb {
  background: var(--color-sky);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-navy); }

/* ── Utility Classes ────────────────────────────────────────── */

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

/* Section padding */
.section { padding-block: var(--section-py); }
.section--lg { padding-block: var(--section-py-lg); }
.section--dark {
  background: var(--bg-dark);
  color: var(--color-white);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--color-white); }

.section--alt { background: var(--bg-alt); }

/* Section label / eyebrow */
.section__label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.section__label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Section heading block */
.section__head { margin-bottom: var(--sp-12); }
.section__head--center { text-align: center; }
.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--sp-4);
}
.section--dark .section__title { color: var(--color-white); }
.section__subtitle {
  font-size: var(--text-md);
  color: var(--text-sub);
  max-width: 600px;
  line-height: var(--leading-loose);
}
.section__head--center .section__subtitle { margin-inline: auto; }

/* Display text */
.display-text {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: var(--leading-tight);
}

/* Text helpers */
.text-navy    { color: var(--color-navy) !important; }
.text-sky     { color: var(--color-sky) !important; }
.text-white   { color: var(--color-white) !important; }
.text-sub     { color: var(--text-sub) !important; }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

/* Font families */
.font-display { font-family: var(--font-display); }
.font-heading { font-family: var(--font-heading); }
.font-mono    { font-family: var(--font-mono); }

/* Flex & Grid 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-col    { display: flex; flex-direction: column; }
.gap-4       { gap: var(--sp-4); }
.gap-6       { gap: var(--sp-6); }
.gap-8       { gap: var(--sp-8); }

/* 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-width: 0;
}

/* Divider */
.divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: var(--sp-6);
}
.divider--center { margin-inline: auto; }

/* Sky accent line (decorative) */
.accent-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--grad-sky);
  border-radius: 2px;
}

/* Highlight span */
.highlight {
  color: var(--accent);
  position: relative;
}

/* Background utilities */
.bg-navy     { background-color: var(--color-navy); }
.bg-dark     { background-color: var(--color-navy-dark); }
.bg-sky      { background-color: var(--color-sky); }
.bg-offwhite { background-color: var(--color-offwhite); }

/* Page hero banner (shared by inner pages) */
.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  background: var(--grad-navy);
  overflow: hidden;
  padding-top: calc(var(--navbar-height) + var(--sp-16));
  padding-bottom: var(--sp-16);
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.page-hero__inner { position: relative; z-index: 1; text-align: center; }
.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--sp-4);
}
.page-hero__accent-line {
  width: 80px;
  height: 3px;
  background: var(--grad-sky);
  border-radius: 2px;
  margin: 0 auto var(--sp-5);
  transform: scaleX(0);
  transform-origin: left;
  animation: lineReveal 0.8s var(--ease-out) 0.4s forwards;
}
@keyframes lineReveal {
  to { transform: scaleX(1); }
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.65);
  margin-top: var(--sp-3);
}
.breadcrumb a {
  color: rgba(255,255,255,0.8);
  transition: color var(--duration-fast) var(--ease-out);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { opacity: 0.4; }
.breadcrumb span { color: var(--accent); }

/* Tooltip */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-navy-dark);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  z-index: var(--z-toast);
}
[data-tooltip]:hover::after { opacity: 1; }

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-navy-dark);
  color: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  pointer-events: all;
  transform: translateX(120%);
  transition: transform var(--duration-slow) var(--ease-spring);
  border-left: 3px solid var(--accent);
}
.toast.is-visible { transform: translateX(0); }
.toast--success { border-left-color: var(--color-success); }
.toast--error   { border-left-color: var(--color-error); }