/* Bara M. Zalloum — viper.surf portfolio styles */
:root {
  --illini-blue: #13294B;
  --illini-blue-deep: #0c1b33;
  --illini-orange: #FF5F05;
  --ink: #1c2733;
  --muted: #526273;
  --bg: #f7f8fa;
  --card: #ffffff;
  --line: #e1e7ee;
  --tint: #eef3f9;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
}

a {
  color: var(--illini-blue);
}

a:hover {
  color: var(--illini-orange);
}

:where(a:any-link, button):focus-visible {
  outline: 3px solid var(--illini-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  background: var(--illini-orange);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

/* Header & Responsive Navigation */
.site-header {
  background: var(--illini-blue);
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(12, 27, 51, 0.16);
}

.site-header.is-measuring * {
  transition: none !important;
}

.header-inner {
  max-inline-size: 1120px;
  margin-inline: auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.brand {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand:hover {
  color: #fff;
}

.brand-domain {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 95, 5, 0.2);
  border: 1px solid rgba(255, 95, 5, 0.55);
  color: #ffd7c2;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}

.menu-button {
  anchor-name: --menu-button;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-block-size: 40px;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.menu-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.site-menu {
  list-style: none;
  position: fixed;
  inset: auto;
  inset-block-start: 4.25rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: 1rem;
  inline-size: min(84dvw, 22rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 5.5rem);
  margin-block-start: 0.5rem;
  padding: 0.75rem;
  overflow: auto;
  background: var(--illini-blue-deep);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  color: #fff;
}

@supports not selector(:popover-open) {
  [popover]:not(.\:popover-open) {
    display: none;
  }
}

.site-menu:is(:popover-open, .\:popover-open) {
  display: grid;
  gap: 0.25rem;
}

.site-menu a,
.dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  inline-size: 100%;
  min-block-size: 40px;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: #e4ecf5;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: start;
}

.site-menu a:hover,
.dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.site-menu a[aria-current="page"] {
  color: #fff;
  box-shadow: inset 3px 0 0 var(--illini-orange);
}

.dropdown-list {
  list-style: none;
  padding-inline-start: 0.75rem;
  margin-block: 0.25rem;
  display: grid;
  gap: 0.2rem;
}

.dropdown-list[hidden] {
  display: none;
}

.dropdown-list a {
  font-size: 0.88rem;
  justify-content: space-between;
}

.site-sub {
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffb185;
}

/* Wide Inline Navigation */
.site-header.is-wide .menu-button {
  display: none;
}

.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.site-header.is-wide .site-menu::backdrop {
  display: none;
}

.site-header.is-wide .site-menu > li > a,
.site-header.is-wide .dropdown-trigger {
  inline-size: auto;
  min-block-size: 36px;
  padding: 0.4rem 0.7rem;
}

.site-header.is-wide .site-menu a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--illini-orange);
}

.site-header.is-wide .nav-dropdown {
  position: relative;
}

.site-header.is-wide .dropdown-list[popover] {
  position: absolute;
  position-area: block-end span-inline-end;
  position-try-fallbacks: flip-block, flip-inline;
  inset: auto;
  height: auto;
  inline-size: max-content;
  min-inline-size: 16.5rem;
  margin-block-start: 0.5rem;
  padding: 0.5rem;
  overflow: visible;
  background: var(--illini-blue-deep);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

@supports not (position-area: block-end) {
  .site-header.is-wide .dropdown-list[popover] {
    position: fixed;
    margin: 0;
  }
}

.site-header.is-wide .dropdown-list::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 100%;
  block-size: 0.5rem;
}

.site-header.is-wide .dropdown-list:not(:is(:popover-open, .\:popover-open)) {
  display: none;
}

.site-header.is-wide .dropdown-list:is(:popover-open, .\:popover-open) {
  display: grid;
}

/* Main Layout */
main {
  max-inline-size: 1120px;
  margin-inline: auto;
  padding: 0 1.25rem 2.5rem;
}

section {
  padding-block: 2.5rem 0.5rem;
  scroll-margin-top: 4.5rem;
}

section h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin-block-end: 1rem;
  border-block-end: 3px solid var(--illini-orange);
  display: inline-block;
  padding-block-end: 0.15rem;
  color: var(--illini-blue);
}

/* Hero */
.hero {
  text-align: center;
  padding-block: 3rem 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--illini-blue);
  line-height: 1.15;
}

.tagline {
  font-size: 1.12rem;
  font-weight: 600;
  margin-block-start: 0.45rem;
}

.hero-sub {
  color: var(--muted);
  max-inline-size: 660px;
  margin: 0.85rem auto 0;
}

.hero-links {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  flex-wrap: balance;
  margin-block-start: 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 40px;
  border: 2px solid var(--illini-blue);
  color: var(--illini-blue);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
  background: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  border-color: var(--illini-orange);
  color: var(--illini-orange);
}

.btn.primary {
  background: var(--illini-blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--illini-orange);
  border-color: var(--illini-orange);
  color: #fff;
}

/* Viper.surf Ecosystem Quick-Launch Bar */
.network-bar {
  margin-block-start: 1.75rem;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(19, 41, 75, 0.05);
}

.network-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-block-end: 0.65rem;
}

.network-pills {
  display: flex;
  flex-wrap: wrap;
  flex-wrap: balance;
  justify-content: center;
  gap: 0.55rem;
}

.site-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-block-size: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--tint);
  border: 1px solid #d5e0ed;
  color: var(--illini-blue);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.site-pill:hover {
  border-color: var(--illini-orange);
  background: #fff5ef;
  color: var(--illini-blue);
  transform: translateY(-1px);
}

.site-pill .dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--illini-orange);
  flex-shrink: 0;
}

/* Projects Header & Filter Bar */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-block-end: 1.15rem;
}

.section-head h2 {
  margin-block-end: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-btn {
  min-block-size: 36px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--illini-orange);
  color: var(--illini-orange);
}

.filter-btn[aria-pressed="true"] {
  background: var(--illini-blue);
  border-color: var(--illini-blue);
  color: #fff;
}

/* Project Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.15rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(19, 41, 75, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(19, 41, 75, 0.1);
}

.card[hidden] {
  display: none;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  inline-size: 100%;
  background: linear-gradient(135deg, #0f223d 0%, #1b3863 100%);
  border-block-end: 1px solid var(--line);
  overflow: hidden;
}

.card-media-btn {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.card-media img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: top center;
}

.card-media.contain img {
  object-fit: contain;
  padding: 0.5rem;
}

.media-badge {
  position: absolute;
  inset-block-end: 0.6rem;
  inset-inline-end: 0.6rem;
  background: rgba(12, 27, 51, 0.84);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  pointer-events: none;
}

.card-preview {
  aspect-ratio: 16 / 10;
  inline-size: 100%;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 95, 5, 0.18), transparent 48%),
    linear-gradient(135deg, var(--illini-blue) 0%, #1c3d6e 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1rem;
  text-align: center;
  border-block-end: 1px solid var(--line);
}

.card-preview .preview-domain {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}

.card-preview .preview-note {
  font-size: 0.78rem;
  font-weight: 600;
  color: #d6e2f0;
}

.card-body {
  padding: 1.15rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card h3 {
  font-size: 1.1rem;
  color: var(--illini-blue);
  line-height: 1.3;
}

.kind-tag {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: var(--tint);
  color: var(--illini-blue);
}

.stack {
  font-size: 0.8rem;
  font-weight: 700;
  color: #c94600;
  letter-spacing: 0.01em;
}

.card-body p {
  font-size: 0.92rem;
}

.card-links {
  margin-block-start: auto;
  padding-block-start: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.88rem;
}

.card-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  border-block-end: 2px solid transparent;
}

.card-links a:hover {
  border-block-end-color: var(--illini-orange);
}

.more-note {
  margin-block-start: 1.25rem;
  padding: 0.9rem 1.15rem;
  background: var(--card);
  border: 1px dashed #c8d4e3;
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

/* Lightbox Dialog */
dialog.img-dialog {
  margin: auto;
  max-inline-size: min(92dvw, 980px);
  max-block-size: 90dvh;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem;
  background: var(--illini-blue-deep);
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

dialog.img-dialog::backdrop {
  background: rgba(10, 18, 32, 0.78);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0.25rem 0.65rem;
}

.dialog-head h3 {
  font-size: 1rem;
  font-weight: 700;
}

.dialog-close {
  min-inline-size: 36px;
  min-block-size: 36px;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--illini-orange);
  border-color: var(--illini-orange);
}

.dialog-img {
  display: block;
  max-inline-size: 100%;
  max-block-size: calc(90dvh - 5rem);
  margin-inline: auto;
  border-radius: 8px;
}

/* Experience */
.timeline article {
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--illini-blue);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-block-end: 0.9rem;
}

.timeline h3 {
  font-size: 1.05rem;
  color: var(--illini-blue);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.15rem 0 0.4rem;
}

/* Skills */
.skill-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.skill-cols > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.skill-cols h3 {
  color: var(--illini-blue);
  font-size: 1rem;
  margin-block-end: 0.35rem;
}

.skill-cols p {
  font-size: 0.95rem;
}

/* Education / Contact */
#education article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

#contact p {
  font-size: 1.05rem;
  font-weight: 600;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 1rem 2.5rem;
  border-block-start: 1px solid var(--line);
  margin-block-start: 2rem;
}

@media (forced-colors: active) {
  .site-menu a[aria-current="page"] {
    outline: 2px solid Highlight;
  }
}
