/* DireenTech site styles */

:root {
  --blue: #1d7fc3;
  --blue-dark: #155f93;
  --blue-tint: #e8f2fa;
  --navy: #0e2233;
  --navy-2: #163349;
  --ink: #1b2733;
  --muted: #5a6b7b;
  --line: #dde4ea;
  --paper: #ffffff;
  --paper-2: #f5f8fa;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(14 34 51 / 6%), 0 4px 16px rgb(14 34 51 / 8%);
  --max: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--font);
}

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

a { color: var(--blue-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 750; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
h4 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--paper); padding: 8px 14px; }
.skip-link:focus { left: 12px; top: 12px; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.75em 1.3em; border-radius: 999px; border: 2px solid var(--blue);
  background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.button-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / 55%); }
.button-ghost:hover { background: rgb(255 255 255 / 12%); border-color: #fff; }
.button-outline { background: transparent; color: var(--blue-dark); }
.button-outline:hover { background: var(--blue-tint); color: var(--blue-dark); }
.button-small { padding: 0.5em 1em; font-size: 0.92rem; }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / 96%); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand img { width: 150px; }

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-item > a {
  display: block; padding: 10px 12px; border-radius: 6px;
  color: var(--ink); font-weight: 560; text-decoration: none;
}
.nav-item > a:hover, .nav-item.is-active > a { color: var(--blue-dark); }
.nav-item.is-active > a { box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }
.has-children > a::after {
  content: ""; display: inline-block; width: 0.42em; height: 0.42em; margin-left: 0.45em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg); opacity: 0.6;
}
.subnav {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 260px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.has-children:hover > .subnav, .has-children:focus-within > .subnav { opacity: 1; visibility: visible; transform: none; }
.subnav a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.subnav a:hover, .subnav a[aria-current="page"] { background: var(--blue-tint); color: var(--blue-dark); }

.site-nav { display: flex; align-items: center; gap: 16px; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer;
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    display: block; width: 20px; height: 2px; background: var(--navy); position: relative; transition: transform 0.2s;
  }
  .nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bar::before { top: -6px; }
  .nav-toggle-bar::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    padding: 12px 20px 20px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    max-height: calc(100vh - 76px); overflow-y: auto;
  }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-item.is-active > a { box-shadow: inset 3px 0 0 var(--blue); }
  .has-children > a::after { display: none; }
  .subnav {
    position: static; opacity: 1; visibility: visible; transform: none;
    border: 0; box-shadow: none; padding: 0 0 6px 14px; min-width: 0;
  }
}

/* Hero (home) */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    linear-gradient(100deg, rgb(14 34 51 / 96%) 0%, rgb(14 34 51 / 86%) 45%, rgb(14 34 51 / 55%) 100%),
    url("/images/hero-circuit.jpg") center / cover no-repeat, var(--navy);
}
.hero-inner { padding: clamp(64px, 11vw, 132px) 20px; max-width: var(--max); }
.hero h1 { color: #fff; max-width: 17em; }
.hero .lede { color: rgb(255 255 255 / 85%); font-size: clamp(1.05rem, 1.8vw, 1.25rem); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Page header band */
.page-header { background: linear-gradient(120deg, var(--navy), var(--navy-2)); color: #fff; padding: clamp(40px, 7vw, 72px) 0; }
.page-header h1 { color: #fff; max-width: 22em; margin-bottom: 0.3em; }
.page-header .lede { color: rgb(255 255 255 / 82%); font-size: 1.12rem; max-width: 42em; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 650; color: #8fc4ea; margin: 0 0 10px; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.post-meta { color: rgb(255 255 255 / 75%); margin: 0; }

/* Page body */
.page-body { padding-top: clamp(36px, 6vw, 64px); padding-bottom: clamp(48px, 7vw, 80px); }
.page-body.has-aside { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
@media (max-width: 900px) { .page-body.has-aside { grid-template-columns: 1fr; gap: 32px; } }

.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose h4 { margin-top: 1.3em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.35em; }
.prose li > ul { margin: 0.35em 0 0; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.prose blockquote { margin: 1.5em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 4px solid var(--blue); color: var(--muted); }
.prose .note { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-size: 0.95rem; color: var(--muted); }
.prose .float-portrait { float: right; width: 300px; max-width: 42%; margin: 0.3em 0 1em 1.6em; }
@media (max-width: 560px) { .prose .float-portrait { float: none; max-width: 260px; margin: 0 0 1.4em; } }
.intro { margin-bottom: 36px; }
.more-link { margin-top: 28px; }
.page-image { width: 100%; border-radius: var(--radius); margin: 0 0 1.8em !important; }

.page-aside { position: sticky; top: 100px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
@media (max-width: 900px) { .page-aside { position: static; } }
.aside-heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }
.aside-heading:not(:first-child) { margin-top: 22px; }
.aside-links { list-style: none; margin: 0; padding: 0; }
.aside-links li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.aside-links li:last-child { border-bottom: 0; }
.aside-links a { text-decoration: none; }
.aside-links a:hover { text-decoration: underline; }
.aside-links a[aria-current="page"] { font-weight: 650; color: var(--navy); }

/* Sections */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--paper-2); }
.section-head { max-width: 44em; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--blue); margin: 0 0 8px; }

/* Cards */
.card-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (min-width: 720px) { .card-grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
a.card { color: inherit; text-decoration: none; }
a.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #c8d6e2; color: inherit; }
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h2, .card-body h3 { margin: 0; font-size: 1.2rem; }
.card-body p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.card-more { margin-top: auto; padding-top: 8px; color: var(--blue-dark); font-weight: 600; font-size: 0.95rem; }
.card-media { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--paper-2); }
.card-logo { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; background: var(--paper-2); padding: 24px; }
.card-logo img { max-height: 70px; width: auto; }
.card-logo .logo-text { font-size: 1.4rem; font-weight: 750; color: var(--navy); text-align: center; }
.icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-tint); color: var(--blue-dark); margin-bottom: 6px;
}
.icon svg { width: 24px; height: 24px; }
.card-date { font-size: 0.85rem; color: var(--muted); }

/* Split feature */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split-portrait { grid-template-columns: 0.8fr 1.2fr; }
@media (max-width: 820px) { .split, .split-portrait { grid-template-columns: 1fr; } .split-portrait img { max-width: 360px; } }
.check-list { list-style: none; padding: 0; margin: 0 0 1.4em; }
.check-list li { position: relative; padding-left: 1.7em; margin-bottom: 0.5em; }
.check-list li::before {
  content: ""; position: absolute; left: 0.15em; top: 0.45em; width: 0.5em; height: 0.85em;
  border-right: 3px solid var(--blue); border-bottom: 3px solid var(--blue); transform: rotate(45deg);
}

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery img { margin: 0; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border-radius: 8px; }
.gallery a:hover img { opacity: 0.85; }

/* Video (click-to-load keeps YouTube from loading until asked) */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--navy); margin: 1.5em 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-launch {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: #fff; text-decoration: none; font-weight: 600; background: linear-gradient(135deg, var(--navy), var(--navy-2));
}
.video-launch::before {
  content: ""; width: 64px; height: 64px; border-radius: 50%;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 7l8 5-8 5z'/%3E%3C/svg%3E") center / 36px no-repeat;
}
.video-launch:hover { color: #fff; }
.video-launch:hover::before { background-color: var(--blue-dark); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin: 8px 0 36px; }
.contact-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.contact-card h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; }
.contact-card p { margin: 0; font-size: 1.15rem; font-weight: 600; }
.contact-card a { text-decoration: none; }

/* News pager */
.post-pager { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 64px; }
.pager-link { display: flex; flex-direction: column; max-width: 46%; text-decoration: none; font-weight: 600; }
.pager-link span { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 650; }
.pager-next { text-align: right; margin-left: auto; }

/* Call-to-action band */
.cta-band { background: var(--blue); color: #fff; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 44px 20px; }
.cta-band h2 { color: #fff; margin-bottom: 0.2em; }
.cta-band p { margin: 0; color: rgb(255 255 255 / 88%); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-band .button { background: #fff; color: var(--blue-dark); border-color: #fff; }
.cta-band .button:hover { background: var(--blue-tint); border-color: var(--blue-tint); }
.cta-band .button-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / 70%); }
.cta-band .button-ghost:hover { background: rgb(255 255 255 / 14%); color: #fff; }

/* Footer */
.site-footer { background: var(--navy); color: rgb(255 255 255 / 78%); font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(2, 1fr); gap: 36px; padding-top: 56px; padding-bottom: 40px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-about img { width: 150px; margin-bottom: 16px; }
.footer-about p { max-width: 30em; }
.footer-heading { color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.site-footer a { color: rgb(255 255 255 / 85%); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / 12%); padding-top: 18px; padding-bottom: 24px; }
.footer-bottom p { margin: 0; font-size: 0.85rem; color: rgb(255 255 255 / 55%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
