/* ============================================================
   Ify Osakwe — Portfolio Styles
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Accent — derived from favicon cyan #22d3ee */
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --accent-soft: rgba(8, 145, 178, 0.08);
  --accent-border: rgba(8, 145, 178, 0.2);

  /* Surfaces */
  --bg: #ffffff;
  --bg-elevated: #f8fafc;
  --panel: #ffffff;
  --card-bg: #f9fafb;
  --card-border: rgba(0, 0, 0, 0.08);

  /* Text */
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  /* Decorative */
  --ring: rgba(0, 0, 0, 0.12);
  --divider: rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);

  /* Layout */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --maxw: 1080px;
  --nav-height: 64px;

  /* Typography */
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-heading: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --ls-body: 0.005em;
  --ls-heading: -0.01em;
  --ls-section: 0.01em;
  --ls-nav: 0.03em;
  --ls-label: 0.05em;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.2s;
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
  --accent: #22d3ee;
  --accent-hover: #06b6d4;
  --accent-soft: rgba(34, 211, 238, 0.1);
  --accent-border: rgba(34, 211, 238, 0.2);

  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --panel: #1e293b;
  --card-bg: #1e293b;
  --card-border: rgba(255, 255, 255, 0.08);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --ring: rgba(255, 255, 255, 0.1);
  --divider: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  letter-spacing: var(--ls-body);
  min-height: 100vh;
  transition:
    background var(--duration) var(--ease),
    color var(--duration) var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--accent);
}

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

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

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--divider);
  transition: background var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

[data-theme="dark"] .nav {
  background: rgba(15, 23, 42, 0.85);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: var(--ls-nav);
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 999px;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navlinks {
  display: flex;
  gap: 4px;
}

.navlinks a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: var(--ls-nav);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease);
}

.navlinks a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.navlinks a.active {
  color: var(--accent);
  font-weight: 600;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ring);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: block;
}
.theme-toggle .icon-sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* Hamburger */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--ring);
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--text);
  padding: 0;
  transition: background var(--duration) var(--ease);
}

.nav-toggle:hover {
  background: var(--accent-soft);
}

.nav-toggle svg {
  width: 18px;
  height: 18px;
}

.nav-toggle .icon-close {
  display: none;
}
.nav-toggle.open .icon-menu {
  display: none;
}
.nav-toggle.open .icon-close {
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 48px;
}

section.hero {
  opacity: 1;
  transform: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
  letter-spacing: 0.01em;
}

.hero-heading {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  margin: 16px 0 0;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: var(--ls-heading);
  color: var(--text);
}

.hero-tagline {
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.25;
  margin: 8px 0 0;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: var(--ls-heading);
  color: var(--text-secondary);
}

.subtitle {
  color: var(--text-muted);
  font-size: 17px;
  margin: 16px 0 24px;
  line-height: 1.6;
}

.cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ring);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-body);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
  color: var(--text);
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------- Hero Photo ---------- */
.hero-photo {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.hero-photo img {
  width: 100%;
  max-height: 420px;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  background: var(--bg-elevated);
  transition:
    box-shadow var(--duration) var(--ease),
    transform var(--duration) var(--ease);
}

.hero-photo img:hover {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* ---------- Sections ---------- */
section {
  padding: 64px 0;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}

section.visible {
  opacity: 1;
  transform: none;
}

section + section {
  border-top: 1px solid var(--divider);
}

.section-header {
  margin-bottom: 28px;
}

.section-title {
  font-size: 26px;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: var(--ls-section);
  font-family: var(--font-heading);
  color: var(--text);
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ---------- Card ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

/* ---------- Skills ---------- */
.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--card-border);
  background: var(--panel);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: default;
  transition:
    transform var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease);
}

.skill-chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
  background: var(--accent-soft);
}

.skill-chip i {
  font-size: 18px;
}

.skill-group-label {
  width: 100%;
  font-weight: 700;
  font-size: 12px;
  margin-top: 18px;
  margin-bottom: 4px;
  color: var(--text-muted);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.skill-group-label:first-child {
  margin-top: 0;
}

/* ---------- Projects ---------- */
.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.project-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--divider);
}

.project-item:first-child {
  padding-top: 0;
}

.project-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.project-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.project-title {
  font-weight: 700;
  font-size: 17px;
  font-family: var(--font-heading);
}

.project-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.project-desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  margin: 0;
}

.project-desc.expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  font-weight: 500;
  font-family: var(--font-body);
  transition: opacity var(--duration) var(--ease);
}

.read-more-btn:hover {
  opacity: 0.75;
}

.project-tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tech-chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.code-link {
  color: var(--accent);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity var(--duration) var(--ease);
}

.code-link:hover {
  opacity: 0.75;
  color: var(--accent);
}

.code-link::after {
  content: "↗";
  font-size: 12px;
  opacity: 0.7;
}

.proprietary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  font-weight: 500;
}

/* ---------- Articles ---------- */
.articles-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.articles-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
}

.articles-list li:last-child {
  border-bottom: none;
}

.articles-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  word-break: break-word;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  transition: color var(--duration) var(--ease);
}

.articles-list a:hover {
  color: var(--accent);
}

.external-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.45;
  transition: opacity var(--duration) var(--ease);
  position: relative;
  top: 1px;
}

.articles-list a:hover .external-icon {
  opacity: 0.8;
}

/* ---------- Contact ---------- */
.contact-section {
  text-align: center;
}

.contact-section .section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-section .section-subtitle {
  max-width: 480px;
}

.contact-section .cta {
  justify-content: center;
}

/* ---------- Footer ---------- */
footer {
  padding: 32px 0;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--divider);
  font-size: 14px;
  transition: color var(--duration) var(--ease);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--duration) var(--ease);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links a svg {
  width: 18px;
  height: 18px;
}

.footer-text {
  margin: 0;
}

/* ---------- Mobile Overlay ---------- */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
}

.nav-overlay.open {
  display: block;
}

/* ---------- Responsive: Tablet & Below ---------- */
@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-photo {
    order: -1;
    justify-self: center;
    width: 100%;
  }

  .hero-photo img {
    max-height: 320px;
    width: 100%;
    margin: 0 auto;
  }

  .hero-text {
    text-align: center;
    align-items: center;
  }

  .cta {
    justify-content: center;
    width: 100%;
  }

  .navlinks {
    display: none;
    position: absolute;
    top: var(--nav-height);
    right: 16px;
    left: 16px;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    gap: 2px;
  }

  [data-theme="dark"] .navlinks {
    background: var(--panel);
  }

  .navlinks.open {
    display: flex;
  }

  .navlinks a {
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 15px;
  }

  section {
    padding: 40px 0;
  }

  .card {
    padding: 18px;
  }

  .section-title {
    font-size: 22px;
  }
}

/* ---------- Responsive: Small Phones ---------- */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-photo img {
    max-height: 260px;
  }

  .hero-heading {
    font-size: clamp(28px, 8vw, 40px);
  }

  .hero-tagline {
    font-size: clamp(16px, 5vw, 22px);
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .brand span:last-child {
    font-size: 13px;
  }
}
