/* ============================================================================
   WARM TERMINAL  —  Afeesudheen portfolio
   A friendly developer console: terminal cleverness + cozy warmth.
   Figtree (friendly sans) + JetBrains Mono (terminal). Plum/cream palette,
   mint + coral accents, springy "boop" hovers. Light/dark toggle; the
   terminal itself stays dark in both themes.
   ========================================================================== */

:root {
  /* dark (default) */
  --bg: #17141f;
  --bg-2: #1f1b2b;
  --bg-3: #262031;
  --text: #f3ece3;
  --muted: #aba1b8;
  --line: rgba(243, 236, 227, 0.1);
  --line-2: rgba(243, 236, 227, 0.18);
  --mint: #6fe0b0;
  --coral: #ff9e80;
  --violet: #c9a0ff;
  --btn-text: #17141f;

  /* terminal is always dark */
  --term: #131019;
  --term-text: #f3ece3;

  --sans: "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1080px;
  --pad: clamp(1.25rem, 5vw, 3.5rem);
  --boop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html[data-theme="light"] {
  --bg: #fbf6ee;
  --bg-2: #ffffff;
  --bg-3: #fff7ea;
  --text: #2a2433;
  --muted: #6e6678;
  --line: rgba(42, 36, 51, 0.12);
  --line-2: rgba(42, 36, 51, 0.22);
  --mint: #0c7a5a;
  --coral: #d8552d;
  --violet: #7c4de0;
  --btn-text: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
h1,
h2,
h3 {
  font-family: var(--sans);
  font-weight: 800;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.02em;
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--mint);
  color: var(--btn-text);
}
:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: var(--mint);
  color: var(--btn-text);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------- reveal */
.reveal {
  transition: opacity 0.6s ease, transform 0.6s var(--boop);
}
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------------- nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem var(--pad);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
  padding-block: 0.7rem;
}
.nav__logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  margin-right: auto;
}
.nav__prompt {
  color: var(--mint);
}
.nav__links {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.nav__links a {
  transition: color 0.2s ease;
}
.nav__links a:hover {
  color: var(--text);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.25s var(--boop), border-color 0.2s ease;
}
.theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
  border-color: var(--mint);
}
.nav__resume {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  transition: transform 0.25s var(--boop), border-color 0.2s ease, color 0.2s ease;
}
.nav__resume:hover {
  transform: translateY(-2px);
  border-color: var(--mint);
  color: var(--mint);
}
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  cursor: pointer;
}
.nav__toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav.open .nav__toggle span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.nav.open .nav__toggle span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ------------------------------------------------------------------ hero */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 7rem var(--pad) 3rem;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
}
@media (min-width: 880px) {
  .hero__inner {
    grid-template-columns: 1.05fr 0.95fr;
  }
}
.hero__right {
  display: flex;
  justify-content: center;
}
.portrait {
  position: relative;
  display: block;
  margin: 0;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--boop), box-shadow 0.3s ease;
}
.portrait img,
.portrait__hi {
  pointer-events: none;
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s var(--boop);
}
.portrait:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.6);
}
.portrait:hover img {
  transform: scale(1.04);
}
.portrait__hi {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2.75rem 1.1rem 1rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}
.portrait__arrow {
  margin-left: auto;
  transition: transform 0.3s var(--boop);
}
.portrait:hover .portrait__arrow {
  transform: translateX(5px);
}
.hero__greet {
  font-family: var(--mono);
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.4rem);
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.sparkle {
  position: relative;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(100deg, var(--mint), var(--violet), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: default;
}
.sparkle::before,
.sparkle::after {
  content: "✦";
  position: absolute;
  font-size: 0.7em;
  color: var(--violet);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.3s var(--boop);
  -webkit-text-fill-color: var(--violet);
}
.sparkle::before {
  top: -0.5em;
  left: -0.6em;
}
.sparkle::after {
  bottom: -0.3em;
  right: -0.5em;
  color: var(--coral);
  -webkit-text-fill-color: var(--coral);
}
.sparkle:hover::before,
.sparkle:focus::before,
.sparkle:hover::after,
.sparkle:focus::after {
  opacity: 1;
  transform: scale(1);
}
.wave {
  display: inline-block;
  transform-origin: 70% 70%;
}
.hero__greet:hover .wave {
  animation: wave 0.7s ease;
}
@keyframes wave {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(16deg);
  }
  40% {
    transform: rotate(-8deg);
  }
  60% {
    transform: rotate(12deg);
  }
  80% {
    transform: rotate(-4deg);
  }
}
.hero__sub {
  font-size: clamp(1.9rem, 1.2rem + 3.6vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin: 0 0 2.25rem;
}
.hero__sub .hl {
  color: var(--mint);
}

/* --------------------------------------------------------------- terminal */
.terminal {
  max-width: 640px;
  background: var(--term);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
  font-family: var(--mono);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.terminal__dots {
  display: inline-flex;
  gap: 0.4rem;
}
.terminal__dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f56;
}
.terminal__dots i:nth-child(2) {
  background: #ffbd2e;
}
.terminal__dots i:nth-child(3) {
  background: #27c93f;
}
.terminal__title {
  font-size: 0.74rem;
  color: #8a8499;
  margin: 0 auto;
  padding-right: 2rem;
}
.terminal__screen {
  padding: 1.1rem 1.1rem 1.2rem;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--term-text);
  min-height: 200px;
  cursor: text;
}
.terminal__output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.t-line {
  margin: 0;
}
.t-cmd {
  color: var(--term-text);
}
.t-cmd .t-sym,
.terminal__prompt .t-sym {
  color: var(--mint);
}
.t-cmd .t-pre {
  color: #8a8499;
}
.t-out {
  color: #c9c2d4;
}
.t-accent {
  color: var(--mint);
}
.t-coral {
  color: var(--coral);
}
.t-dim {
  color: #76707f;
}
.t-err {
  color: #ff8a8a;
}
.terminal__form {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.terminal__prompt {
  color: #8a8499;
  white-space: nowrap;
}
.terminal__prompt .t-path {
  color: var(--violet);
}
.terminal__input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--term-text);
  font-family: var(--mono);
  font-size: 0.86rem;
  caret-color: var(--mint);
  padding: 0;
}

/* ----------------------------------------------------------- hero cmds */
.hero__cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.hero__cmds button {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: transform 0.25s var(--boop), border-color 0.2s ease, color 0.2s ease;
}
.hero__cmds button::before {
  content: "› ";
  color: var(--mint);
}
.hero__cmds button:hover {
  transform: translateY(-3px) rotate(-1.5deg);
  border-color: var(--mint);
  color: var(--mint);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--boop), box-shadow 0.25s ease;
}
.btn--primary {
  background: var(--mint);
  color: var(--btn-text);
  font-weight: 700;
}
.btn--primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px -12px var(--mint);
}

/* --------------------------------------------------------------- sections */
.section {
  padding: clamp(4.5rem, 11vh, 8rem) 0;
}
.section > * {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--mint);
  margin: 0 0 1rem;
}
.eyebrow .t-sym {
  opacity: 0.7;
}
.section__title {
  font-size: clamp(1.8rem, 1.3rem + 2.6vw, 3.1rem);
  max-width: 20ch;
  margin-bottom: 2.5rem;
}

/* ------------------------------------------------------------------ about */
.about__grid {
  display: grid;
  gap: 1.5rem;
}
.about .section__title {
  margin-bottom: 1.25rem;
}
.about__body p {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 60ch;
}
.about__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  margin: 2.25rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
}
.about__meta dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--mint);
  margin-bottom: 0.35rem;
}
.about__meta dd {
  margin: 0;
  font-size: 0.95rem;
}

/* ----------------------------------------------- cards (skills/work/certs) */
.stack__grid,
.work__grid,
.certs__grid {
  display: grid;
  gap: 1.1rem;
}
.stack__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
}
.work__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}
.certs__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.stack__card,
.work__card,
.cert__card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.6rem;
  transition: transform 0.3s var(--boop), border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.stack__card:hover,
.work__card:hover,
.cert__card:hover {
  transform: translateY(-5px) rotate(-0.4deg);
  border-color: var(--line-2);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.4);
}
.stack__name {
  font-size: 1.12rem;
  margin-bottom: 1rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chip {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 0.32rem 0.65rem;
  border-radius: 8px;
}

/* ------------------------------------------------------------------- work */
.work__card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.work__role {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--coral);
}
.work__name {
  font-size: 1.3rem;
}
.work__summary {
  color: var(--muted);
  font-size: 0.95rem;
}
.work__outcome {
  font-size: 0.88rem;
  color: var(--text);
  padding-left: 0.85rem;
  border-left: 2px solid var(--mint);
}
.work__links {
  margin-top: auto;
}
.work__links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--mint);
}
.work__links a:hover {
  text-decoration: underline;
}
.work__card .chips {
  margin-top: 0.2rem;
}

/* ------------------------------------------------------------- experience */
.exp__wrap {
  max-width: 800px;
}
.exp__item {
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) 1fr;
  gap: 1.5rem;
  padding: 1.85rem 0;
  border-top: 1px solid var(--line);
}
.exp__item:last-of-type {
  border-bottom: 1px solid var(--line);
}
.exp__period {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}
.exp__role {
  font-size: 1.25rem;
  margin-bottom: 0.2rem;
}
.exp__company {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--mint);
  margin-bottom: 0.9rem;
}
.exp__bullets {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
}
.exp__bullets li {
  font-size: 0.94rem;
}
.exp__edu {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.exp__edu b {
  color: var(--text);
  font-weight: 500;
}

/* ------------------------------------------------------------------ certs */
.cert__issuer {
  font-size: 1.08rem;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cert__issuer::before {
  content: "◆";
  color: var(--coral);
  font-size: 0.7rem;
}
.cert__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.cert__list li {
  font-size: 0.9rem;
  color: var(--muted);
  padding-left: 1.2rem;
  position: relative;
}
.cert__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--mint);
}

/* -------------------------------------------------------------------- now */
.now__intro {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 1.5rem;
}
.now__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  max-width: 62ch;
}
.now__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 1.05rem;
  color: var(--muted);
}
.now__list li::before {
  content: "▸";
  color: var(--mint);
}

/* ---------------------------------------------------------------- contact */
.contact__title {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.6rem);
  margin-bottom: 2.5rem;
}
.contact__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
}
.contact__big {
  font-family: var(--mono);
  font-size: clamp(1.1rem, 0.9rem + 1.4vw, 1.7rem);
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--mint);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 0.3rem;
  transition: transform 0.25s var(--boop);
}
.contact__big:hover {
  transform: translateY(-2px);
}
.contact__social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
}
.contact__social a:hover {
  color: var(--mint);
}
.contact__form {
  display: grid;
  gap: 1rem;
}
.field {
  display: grid;
  gap: 0.4rem;
}
.field label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.field input,
.field textarea {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--mint);
}
.contact__form .btn {
  justify-self: start;
}

/* ----------------------------------------------------------------- footer */
.footer {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 2.5rem var(--pad) 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------------------------------------- responsive */
@media (min-width: 800px) {
  .about__grid {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }
  .about .section__title {
    margin-bottom: 0;
  }
}
@media (max-width: 760px) {
  .nav__links {
    position: fixed;
    inset: 62px var(--pad) auto;
    flex-direction: column;
    gap: 1.1rem;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 16px;
    padding: 1.4rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav.open .nav__links {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .nav__toggle {
    display: flex;
  }
  .nav__resume {
    display: none;
  }
  .exp__item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
