/* ============ Israel Johnson - Portfolio ============ */

:root {
  --bg: #0a0c11;
  --bg-raise: #10131a;
  --card: #12151d;
  --border: #1f2430;
  --border-soft: #181c26;
  --text: #e9ecf2;
  --muted: #98a1b0;
  --dim: #6b7280;
  --accent: #3ddc78;
  --accent-strong: #4ade80;
  --accent-dim: rgba(61, 220, 120, 0.12);
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --container: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

::selection { background: var(--accent); color: #06130b; }

a { color: inherit; }

/* ============ Scroll reveal (staggered via JS-set --d) ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease-out) var(--d, 0ms),
    transform 0.7s var(--ease-out) var(--d, 0ms);
}
.reveal.visible { opacity: 1; transform: none; }

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 17, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  animation: nav-drop 0.7s var(--ease-out) both;
}
@keyframes nav-drop {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo-tilde { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-links > a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s;
}
.nav-links > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav-links > a:hover { color: var(--text); }
.nav-links > a:hover::after,
.nav-links > a.active::after { transform: scaleX(1); }
.nav-links > a.active { color: var(--accent); }

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
  background: var(--bg-raise);
  transition: border-color 0.25s, background 0.25s;
}
.btn-github::after { display: none; }
.btn-github:hover { border-color: var(--accent); background: var(--card); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
  padding-top: 110px;
  padding-bottom: 130px;
}

/* Load-in choreography: status -> name lines -> rule -> role -> tags -> desc -> actions */
.hero-anim {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.8s var(--ease-out) forwards;
}
.hero-status { animation-delay: 0.15s; }
.hero-role   { animation-delay: 0.75s; }
.hero-tags   { animation-delay: 0.9s; }
.hero-desc   { animation-delay: 1.05s; }
.hero-actions{ animation-delay: 1.2s; }
@keyframes rise {
  to { opacity: 1; transform: none; }
}

.hero-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}
.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 120, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(61, 220, 120, 0); }
}

.hero-name {
  font-size: clamp(3.4rem, 8.5vw, 6.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em; /* descender clearance */
}
.line {
  display: block;
  transform: translateY(110%);
  animation: line-up 0.9s var(--ease-out) forwards;
}
.line-mask:nth-child(1) .line { animation-delay: 0.25s; }
.line-mask:nth-child(2) .line { animation-delay: 0.4s; }
@keyframes line-up {
  to { transform: translateY(0); }
}
.accent { color: var(--accent); }

.hero-rule {
  width: 56px;
  height: 3px;
  background: var(--accent);
  margin: 26px 0 22px;
  transform: scaleX(0);
  transform-origin: left;
  animation: rule-grow 0.6s var(--ease-out) 0.65s forwards;
}
@keyframes rule-grow {
  to { transform: scaleX(1); }
}

.hero-role {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-tags {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 26px;
}
.hero-tags span { color: var(--dim); margin: 0 6px; }

.hero-desc {
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 40px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: var(--accent-strong);
  color: #06130b;
}
.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(74, 222, 128, 0.28);
}
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent); }
.btn-lg { padding: 16px 44px; font-size: 1.05rem; }

/* Photo: clip reveal + green border draws in */
.hero-photo { position: relative; }
.photo-frame {
  position: relative;
  overflow: hidden;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--card);
  clip-path: inset(0 0 100% 0);
  animation: photo-reveal 1s var(--ease-out) 0.55s forwards;
}
@keyframes photo-reveal {
  to { clip-path: inset(0 0 0 0); }
}
.photo-frame::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  animation: border-draw 0.8s var(--ease-out) 1.15s forwards;
  z-index: 1;
}
@keyframes border-draw {
  to { transform: scaleY(1); }
}

/* ============ Marquee ============ */
.marquee {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
  padding: 20px 0;
}
.marquee-track {
  display: flex;
  gap: 44px;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-track span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--dim);
  white-space: nowrap;
}
.marquee-track i { color: var(--border); font-style: normal; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============ Sections ============ */
.section { padding: 120px 40px; }

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 22px;
  margin-bottom: 60px;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 52px;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out) 0.25s;
}
.section-title.visible::after { transform: scaleX(1); }

.divider {
  border: none;
  border-top: 1px solid var(--border-soft);
}

/* ============ About ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 70px;
  align-items: start;
}

.about-text p { color: var(--muted); margin-bottom: 24px; }

.about-meta {
  list-style: none;
  display: flex;
  gap: 34px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.about-meta li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}
.about-meta svg { color: var(--accent); }

.cert-stack { display: flex; flex-direction: column; gap: 22px; }

.cert-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 28px 30px;
  transition: border-color 0.25s, transform 0.35s var(--ease-out);
}
.cert-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.cert-icon { color: var(--accent); flex-shrink: 0; }
.cert-card h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 6px; }
.cert-card p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
}

/* ============ Skills ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 34px 30px;
  transition: border-color 0.25s, transform 0.35s var(--ease-out);
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.skill-icon {
  color: var(--accent);
  margin-bottom: 22px;
  transition: transform 0.35s var(--ease-out);
}
.skill-card:hover .skill-icon { transform: translateY(-3px); }

.skill-card h3 { font-size: 1.02rem; font-weight: 600; }

.skill-card hr {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 22px 0;
}

.skill-card ul { list-style: none; }
.skill-card li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding: 7px 0;
}
.skill-card li::before {
  content: "▸";
  color: var(--accent);
  margin-right: 10px;
  font-size: 0.7rem;
}

/* ============ Projects ============ */
.projects-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.projects-head .section-title { margin-bottom: 60px; }
.projects-handles {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 60px;
}
.projects-handles a { color: var(--muted); text-decoration: none; }
.projects-handles a:hover { color: var(--accent); }

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, transform 0.35s var(--ease-out);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.folder-icon { color: var(--accent); }
.project-link { color: var(--dim); transition: color 0.2s; }
.project-link:hover { color: var(--text); }

.project-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 14px; }
.project-card > p:not(.project-tags) { color: var(--muted); font-size: 0.94rem; flex-grow: 1; }

.project-tags {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 26px;
}

.project-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 26px;
  padding: 26px 34px;
}
.wide-icon { color: var(--accent); flex-shrink: 0; }
.wide-body { flex-grow: 1; }
.wide-body h3 { margin-bottom: 6px; }
.wide-body p { color: var(--muted); font-size: 0.9rem; }
.wide-tags { margin-top: 0; white-space: nowrap; }
.wide-link { flex-shrink: 0; }

/* ============ Experience ============ */
.timeline { position: relative; max-width: 820px; }

/* line draws itself downward as items enter */
.timeline::before {
  content: "";
  position: absolute;
  left: 199px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.6s var(--ease-out) 0.2s;
}
.timeline.visible::before { transform: scaleY(1); }

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 170px 60px 1fr;
  padding-bottom: 64px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-align: right;
  padding-top: 4px;
}

.timeline-dot {
  position: relative;
  justify-self: center;
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  margin-top: 6px;
  z-index: 1;
  transition: box-shadow 0.3s;
}
.timeline-item:hover .timeline-dot { box-shadow: 0 0 0 5px var(--accent-dim); }

.timeline-body h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 4px; }
.timeline-org {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--dim);
  margin-bottom: 14px;
}
.timeline-body > p:last-child { color: var(--muted); font-size: 0.94rem; max-width: 560px; }

.edu-card {
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 28px 34px;
  margin-top: 90px;
  transition: border-color 0.25s;
}
.edu-card:hover { border-color: var(--accent); }
.edu-icon { color: var(--accent); flex-shrink: 0; }
.edu-card h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 5px; }
.edu-card p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--dim);
}

/* ============ Contact ============ */
.contact {
  border-top: 1px solid var(--border-soft);
  padding: 150px 0 130px;
}

.contact-inner {
  position: relative;
  text-align: center;
}

.contact h2 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 30px;
}

.contact-sub {
  color: var(--muted);
  margin-bottom: 48px;
}

.contact-meta {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 46px;
  margin-top: 60px;
  flex-wrap: wrap;
}
.contact-meta li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--muted);
}
.contact-meta svg { color: var(--accent); }
.contact-meta a { text-decoration: none; }
.contact-meta a:hover { color: var(--accent); }

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--dim);
}
.footer a { color: var(--dim); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--accent); }
.footer-sep { margin: 0 8px; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; padding-top: 80px; padding-bottom: 90px; }
  .hero-photo { max-width: 420px; }
  .about-grid { grid-template-columns: 1fr; gap: 50px; }
}

@media (max-width: 760px) {
  .container { padding: 0 22px; }
  .section { padding: 80px 22px; }
  .hero { padding-top: 56px; padding-bottom: 70px; gap: 44px; }
  .hero-status { margin-bottom: 24px; flex-wrap: wrap; row-gap: 4px; }
  .hero-name { font-size: clamp(3rem, 17vw, 4.2rem); }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-head { display: block; }
  .projects-head .section-title { margin-bottom: 24px; }
  .projects-handles {
    margin-bottom: 40px;
    flex-wrap: wrap;
    row-gap: 6px;
    font-size: 0.72rem;
  }
  .projects-handles a { overflow-wrap: anywhere; }
  .hero-actions .btn { flex: 1 1 auto; text-align: center; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 72px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg-raise);
    border-bottom: 1px solid var(--border);
    padding: 20px 22px 26px;
    transform: translateY(-130%);
    transition: transform 0.3s var(--ease-out);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links > a { padding: 10px 0; font-size: 0.95rem; }
  .btn-github { margin-top: 10px; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-wide { flex-direction: column; align-items: flex-start; gap: 16px; }
  .wide-tags { white-space: normal; }

  .timeline::before { left: 6px; }
  .timeline-item { display: flex; flex-direction: column; padding-left: 34px; }
  .timeline-dot { position: absolute; left: 0; top: 6px; }
  .timeline-date { text-align: left; order: -1; margin-bottom: 6px; }

  .contact-meta { flex-direction: column; align-items: center; gap: 18px; }
  .br-wide { display: none; }
  .footer-inner { justify-content: center; text-align: center; }
}

/* ============ Reduced motion: everything collapses to static ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  .nav { animation: none; }
  .hero-anim { opacity: 1; transform: none; animation: none; }
  .line { transform: none; animation: none; }
  .hero-rule { transform: scaleX(1); animation: none; }
  .photo-frame img { clip-path: none; animation: none; }
  .photo-frame::before { transform: scaleY(1); animation: none; }
  .status-dot { animation: none; box-shadow: 0 0 10px var(--accent); }
  .section-title::after { transform: scaleX(1); transition: none; }
  .timeline::before { transform: scaleY(1); transition: none; }
  * { transition-duration: 0.01ms !important; }
}
