/*
  Faniel Habte Portfolio
  - Clean, minimal, responsive
  - Fluid typography + spacing with clamp()
*/

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  /* Layout */
  --container: 1100px;
  --radius: 16px;
  --radius-sm: 12px;
  --nav-height: 72px;

  /* Fluid spacing */
  --s1: clamp(0.5rem, 0.8vw, 0.75rem);
  --s2: clamp(0.75rem, 1.2vw, 1rem);
  --s3: clamp(1rem, 1.8vw, 1.5rem);
  --s4: clamp(1.5rem, 2.6vw, 2.25rem);
  --s5: clamp(2rem, 4vw, 3rem);

  /* Fluid type */
  --fs-base: clamp(15px, 1.05vw, 17px);
  --fs-sm: clamp(13px, 0.95vw, 14px);
  --fs-lg: clamp(17px, 1.25vw, 20px);
  --h1: clamp(2rem, 4.2vw, 3rem);
  --h2: clamp(1.45rem, 3.2vw, 2.25rem);
  --h3: clamp(1.12rem, 2.2vw, 1.45rem);

  /* Colors */
  --bg: #ffffff;
  --text: #101215;
  --muted: rgba(16, 18, 21, 0.72);
  --muted2: rgba(16, 18, 21, 0.56);
  --surface: #f7f8fa;
  --card: #ffffff;
  --border: rgba(16, 18, 21, 0.10);
  --shadow: 0 12px 48px rgba(16, 18, 21, 0.10);
  --shadow-soft: 0 8px 24px rgba(16, 18, 21, 0.08);

  --accent: #2d6cdf;
  --accent-ink: #ffffff;

}

body.dark-theme {
  --bg: #000000;
  --text: #f4f6f8;
  --muted: rgba(244, 246, 248, 0.74);
  --muted2: rgba(244, 246, 248, 0.56);
  --surface: #0f0f10;
  --card: #060606;
  --border: rgba(244, 246, 248, 0.12);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s ease, color 0.25s ease;
}

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

a {
  color: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  transform: translateY(-200%);
  z-index: 99999;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Navbar */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1rem;
}

.brand-logo {
  height: clamp(30px, 2.8vw, 46px);
  width: auto;
  display: block;
}

body.dark-theme .brand-logo {
  filter: invert(1);
}


.brand-dot {
  color: var(--accent);
}

.nav-location {
  display: flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: var(--fs-sm);
  color: var(--muted2);
  white-space: nowrap;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.nav-link {
  text-decoration: none;
  font-size: var(--fs-sm);
  color: var(--muted);
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: color-mix(in oklab, var(--text) 8%, transparent);
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
  background: color-mix(in oklab, var(--text) 10%, transparent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, background 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

/* Hamburger */
.mobile-menu-toggle {
  display: none;
}

.hamburger {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle.is-open .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile drawer */
.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  width: min(360px, 88vw);
  z-index: 1200;
}

.mobile-drawer-backdrop {
  display: none;
}

.mobile-drawer-panel {
  position: static;
  height: auto;
  width: 100%;
  max-height: calc(100vh - var(--nav-height) - var(--s2));
  overflow: auto;
  background: color-mix(in oklab, var(--card) 80%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0 0 var(--radius) var(--radius);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: var(--s2) var(--s3) var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  transform: none;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-title {
  font-weight: 600;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-drawer-links .nav-link {
  padding: 0.75rem 0.75rem;
  border-radius: 12px;
}

.mobile-drawer-cta {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 70%, var(--border));
  color: var(--accent-ink);
}

.btn-ghost {
  background: color-mix(in oklab, var(--card) 88%, transparent);
}

/* Hero */
.hero {
  padding-top: 92px; /* space for fixed nav */
  padding-bottom: var(--s5);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s5);
  align-items: start;
}

.eyebrow {
  font-size: var(--fs-sm);
  color: var(--muted2);
  margin-bottom: var(--s2);
}

.hero-title {
  font-size: var(--h1);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--s2);
}

.hero-subtitle {
  font-size: var(--fs-lg);
  color: var(--muted);
  max-width: 56ch;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--s3) 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-card {
  position: sticky;
  top: 92px;
}

.hero-photo-wrap {
  padding: var(--s3);
  padding-bottom: 0;
}

.profile-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: calc(var(--radius) + 10px);
  border: 1px solid var(--border);
}

.hero-card-body {
  padding: var(--s3);
}

.hero-card-title {
  font-size: var(--fs-sm);
  color: var(--muted2);
  margin-bottom: 0.5rem;
}

.hero-card-links {
  display: flex;
  gap: 1rem;
  margin-top: var(--s2);
}

.text-link {
  text-decoration: none;
  font-size: var(--fs-sm);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem;
  border-radius: 10px;
}

.text-link:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--text) 8%, transparent);
}

.external-icon {
  font-size: 0.85em;
  opacity: 0.75;
}

/* Sections */
.section {
  padding: var(--s5) 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: var(--s4);
}

.section-title {
  font-size: var(--h2);
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--muted);
  max-width: 70ch;
}

.section-actions {
  margin-top: var(--s2);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: var(--s3) var(--s3) 0 var(--s3);
  background: color-mix(in oklab, var(--text) 7%, transparent);
  color: var(--text);
}

.card-title {
  font-size: var(--h3);
  margin: var(--s2) var(--s3) 0 var(--s3);
}

.card-text {
  margin: var(--s2) var(--s3);
  color: var(--muted);
}

.card-note {
  margin: var(--s2) var(--s3) var(--s3);
  color: var(--muted2);
  font-size: var(--fs-sm);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 88%, transparent);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.chip i {
  color: var(--muted2);
}

.chip-soft {
  background: color-mix(in oklab, var(--text) 6%, transparent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--s2) var(--s3) var(--s3);
}

/* Lists */
.bullets {
  list-style: none;
  padding-left: 0;
}

.bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin: 0.35rem 0;
  color: var(--muted);
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--text) 38%, transparent);
}

.bullets-tight li {
  margin: 0.25rem 0;
}

/* Story gallery */
.mini-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0 var(--s3) var(--s3);
}

.mini-tile {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  color: var(--muted2);
  background: color-mix(in oklab, var(--card) 90%, transparent);
  font-size: var(--fs-sm);
}

.mini-tile.mini-photo {
  padding: 0.4rem;
}

.mini-tile.mini-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 6px);
}

@media (min-width: 921px) {
  .mini-tile.mini-photo img {
    aspect-ratio: 1 / 1;
  }
}

/* Callout */
.callout {
  margin-top: var(--s4);
  padding: var(--s3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--accent) 10%, var(--card));
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
}

.callout-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 18%, transparent);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.callout-text {
  color: var(--muted);
}

/* Timeline */
.timeline {
  position: relative;
  margin-top: var(--s3);
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: var(--s3) 0 var(--s3) var(--s3);
}

.timeline-dot {
  position: absolute;
  left: -7px;
  top: calc(var(--s3) + 0.3rem);
  width: 14px;
  height: 14px;
  border-radius: 99px;
  background: var(--card);
  border: 2px solid color-mix(in oklab, var(--text) 30%, transparent);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  color: var(--muted2);
}

.timeline-range {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.timeline-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--text) 6%, transparent);
}

.timeline-title {
  font-size: var(--h3);
  margin-top: 0.4rem;
}

.timeline-text {
  color: var(--muted);
  margin-top: 0.35rem;
  max-width: 80ch;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

.skills-grid .card-icon {
  margin-bottom: 0;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.project-card-wide {
  grid-column: span 2;
}

@media (max-width: 920px) {
  .project-card-wide {
    grid-column: span 1;
  }

  .brand-logo {
    height: 30px;
  }
}

/* Weekly streak / accordion */
.streak-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--border));
  background: color-mix(in oklab, var(--card) 88%, transparent);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.streak-pill i { color: var(--accent); }

.streak-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--text) 6%, transparent);
}

.streak-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--accent),
    color-mix(in oklab, var(--accent) 40%, var(--text))
  );
  border-radius: 999px;
  transition: width 320ms ease;
}

.accordion {
  border-top: 1px dashed var(--border);
  padding-top: 0.75rem;
}

.accordion > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--text);
}

.accordion > summary::-webkit-details-marker {
  display: none;
}

.weekly-list {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.6rem;
}

.weekly-item {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 6px);
  padding: 0.7rem 0.8rem;
  background: color-mix(in oklab, var(--card) 92%, transparent);
}

.weekly-item summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 0.85rem;
}

.weekly-item summary::-webkit-details-marker {
  display: none;
}

.weekly-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: var(--fs-sm);
  color: var(--muted2);
}

.weekly-title {
  font-weight: 700;
}

.weekly-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 88%, transparent);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.skill-chip i { color: var(--muted2); }

.weekly-body {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

@media (max-width: 520px) {
  .weekly-item summary {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .weekly-chips {
    justify-content: flex-start;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}

.project-title {
  font-size: var(--h3);
  letter-spacing: -0.01em;
}

.project-status {
  font-size: var(--fs-sm);
  color: var(--muted2);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--text) 6%, transparent);
  white-space: nowrap;
}

/* Project status colors (subtle, theme-friendly) */
.project-status.status-ongoing {
  background: color-mix(in oklab, #2d6cdf 14%, var(--card));
  border-color: color-mix(in oklab, #2d6cdf 32%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #2d6cdf);
}

.project-status.status-progress {
  background: color-mix(in oklab, #0ea5e9 14%, var(--card));
  border-color: color-mix(in oklab, #0ea5e9 32%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #0ea5e9);
}

.project-status.status-drafted {
  background: color-mix(in oklab, #38bdf8 14%, var(--card));
  border-color: color-mix(in oklab, #38bdf8 32%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #38bdf8);
}

.project-status.status-completed {
  background: color-mix(in oklab, #22c55e 14%, var(--card));
  border-color: color-mix(in oklab, #22c55e 32%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #22c55e);
}

.project-status.status-prototype {
  background: color-mix(in oklab, #8b5cf6 14%, var(--card));
  border-color: color-mix(in oklab, #8b5cf6 32%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #8b5cf6);
}

.project-status.status-iterating {
  background: color-mix(in oklab, #14b8a6 14%, var(--card));
  border-color: color-mix(in oklab, #14b8a6 32%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #14b8a6);
}

.project-status.status-notes {
  background: color-mix(in oklab, #64748b 12%, var(--card));
  border-color: color-mix(in oklab, #64748b 28%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #64748b);
}

.project-status.status-streak {
  background: color-mix(in oklab, #f59e0b 14%, var(--card));
  border-color: color-mix(in oklab, #f59e0b 34%, var(--border));
  color: color-mix(in oklab, var(--text) 86%, #f59e0b);
}


.project-text {
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: auto;
}

.project-card .chip {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

.contact-email {
  font-weight: 700;
  text-decoration: none;
}

.contact-email:hover {
  text-decoration: underline;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: var(--s2) var(--s3) var(--s3);
}

/* Footer */
.footer {
  padding: var(--s5) 0;
  text-align: center;
}

.footer-signoff {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.footer-meta {
  color: var(--muted2);
  font-size: var(--fs-sm);
}

/* Reveal animations */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .icon-btn {
    transition: none;
  }
}

/* Responsive */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    position: relative;
    top: 0;
  }

  .projects-grid,
  .skills-grid,
  .grid-2,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .mini-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-location {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }
}

/* Utilities */
body.no-scroll { overflow: hidden; }
