/* ─── Code 3 Workshop · Homepage ─── */
/* Design tokens aligned with CardioStrip / EKG Simulator */

:root {
  /* White · EMS blue · Gold */
  --bg: #f3f6fb;
  --bg-elevated: #ffffff;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #eef3fa;
  --border: rgba(0, 63, 135, 0.12);
  --border-strong: rgba(0, 63, 135, 0.22);
  --text: #0b1f3a;
  --text-muted: #4a5f78;
  --text-dim: #6b7f96;
  --accent: #c9a227;
  --accent-soft: #e8d48b;
  --accent-dim: rgba(201, 162, 39, 0.14);
  --accent-glow: rgba(201, 162, 39, 0.32);
  --cyan: #0057b8;
  --cyan-dim: rgba(0, 87, 184, 0.1);
  --amber: #c9a227;
  --amber-dim: rgba(201, 162, 39, 0.14);
  --rose: #c43c4e;
  --violet: #3d5a80;
  --violet-dim: rgba(61, 90, 128, 0.1);
  --success: #1a8f5c;
  --ems: #003f87;
  --ems-mid: #0057b8;
  --ems-light: #2b7fd4;
  --gold: #c9a227;
  --gold-bright: #d4af37;
  --gold-soft: #f5e9c0;
  --surface: rgba(0, 63, 135, 0.04);
  --surface-hover: rgba(0, 63, 135, 0.07);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow: 0 12px 40px rgba(0, 63, 135, 0.1);
  --shadow-soft: 0 6px 20px rgba(0, 63, 135, 0.08);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --content-max: 960px;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(201, 162, 39, 0.35);
  color: #0b1f3a;
}

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

/* ─── Ambient background ─── */

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: orb-drift 18s var(--ease) infinite alternate;
}

.bg-orb-a {
  width: 520px;
  height: 520px;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(0, 87, 184, 0.18), transparent 68%);
}

.bg-orb-b {
  width: 460px;
  height: 460px;
  top: -8%;
  right: -6%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.18), transparent 68%);
  animation-delay: -6s;
}

.bg-orb-c {
  width: 480px;
  height: 480px;
  bottom: -18%;
  left: 35%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.12), transparent 70%);
  animation-delay: -11s;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 63, 135, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 63, 135, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
}

.bg-noise {
  position: absolute;
  inset: 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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, 24px) scale(1.08); }
}

/* ─── App shell ─── */

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */

.header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  min-height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 14px var(--accent-glow));
  transition: transform 0.35s var(--ease), filter 0.35s var(--ease);
}

.brand:hover .brand-mark {
  transform: scale(1.04) rotate(-2deg);
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--ems) 0%, var(--ems-mid) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text p {
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ─── Main ─── */

.main {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* ─── Glass panel / hero ─── */

.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  overflow: hidden;
  position: relative;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.25), transparent);
  pointer-events: none;
  z-index: 1;
}

.hero {
  padding: 2rem 2rem 2.15rem;
  background:
    linear-gradient(180deg, rgba(0, 63, 135, 0.045), transparent 50%),
    linear-gradient(180deg, #ffffff, #f7f9fd);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}

.title-kicker {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.45rem;
}

.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 0.35rem;
  max-width: 300px;
  width: 100%;
}

.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 300px;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0, 63, 135, 0.14));
}

.hero-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 42rem;
  padding-top: 0.35rem;
}

.hero-copy {
  font-size: clamp(1.12rem, 2.2vw, 1.28rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.7;
  letter-spacing: -0.01em;
  max-width: 40ch;
  margin: 0 auto;
}

.hero-link {
  color: var(--ems-mid);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(201, 162, 39, 0.55);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}

.hero-link:hover {
  color: var(--ems);
  text-decoration-color: var(--gold-bright);
}

.hero-byline {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ems);
  position: relative;
  padding-top: 0.95rem;
  margin: 0;
}

.hero-byline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ─── Projects section ─── */

.section-head {
  margin-bottom: 1.15rem;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.section-head p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 48ch;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

/* ─── Project profile cards ─── */

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.35rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.25s var(--ease),
    background 0.25s var(--ease),
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.project-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.25s;
  background: linear-gradient(90deg, var(--ems-mid), var(--gold));
}

a.project-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

a.project-card:hover::after {
  opacity: 1;
}

a.project-card:focus-visible {
  outline: 2px solid var(--ems-mid);
  outline-offset: 3px;
}

.card-ekg::after {
  background: linear-gradient(90deg, var(--ems-mid), var(--gold));
}

.project-card-soon {
  opacity: 0.88;
  cursor: default;
}

.project-card-soon::after {
  background: linear-gradient(90deg, var(--violet), var(--ems-light));
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.project-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.project-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.project-icon-muted {
  filter: drop-shadow(0 0 10px rgba(61, 90, 128, 0.25));
  opacity: 0.9;
}

.status-chip {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.status-live {
  color: var(--success);
  background: rgba(26, 143, 92, 0.1);
  border-color: rgba(26, 143, 92, 0.28);
}

.status-soon {
  color: var(--text-dim);
  background: var(--surface);
  border-color: var(--border);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.project-subtitle {
  font-size: 0.82rem;
  color: var(--cyan);
  font-weight: 600;
  margin-top: 0.2rem;
  margin-bottom: 0.7rem;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.1rem;
}

.project-tags li {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ems-mid);
  transition: gap 0.2s var(--ease), color 0.2s;
}

a.project-card:hover .project-cta {
  gap: 0.6rem;
  color: var(--ems);
}

/* ─── Footer ─── */

.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.footer-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-align: center;
  padding: 0.48rem 1rem;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.1);
  backdrop-filter: blur(8px);
  max-width: min(100%, 36rem);
  white-space: normal;
  cursor: pointer;
  transition:
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    filter 0.18s var(--ease);
}

.footer-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 4px 22px rgba(201, 162, 39, 0.22);
}

.footer-pill:active {
  transform: scale(0.98);
}

.footer-pill:focus-visible {
  outline: 2px solid var(--ems-mid);
  outline-offset: 3px;
}

/* ─── Responsive ─── */

@media (max-width: 720px) {
  .header {
    padding: 0.9rem 1.1rem;
  }

  .main {
    padding: 1.35rem 1.1rem 2.25rem;
    gap: 1.75rem;
  }

  .hero {
    padding: 1.5rem 1.2rem 1.65rem;
  }

  .hero-logo {
    max-width: 240px;
  }

  .hero-copy {
    max-width: none;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb {
    animation: none;
  }

  .project-card,
  .brand-mark,
  .project-cta {
    transition: none;
  }

  a.project-card:hover {
    transform: none;
  }
}
