:root {
  --black: #000;
  --white: #fff;
  --yellow: #ffe600;
  --grey: #a8a8a8;
  --line: #2a2a2a;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
.section--yellow :focus-visible,
.section--white :focus-visible {
  outline-color: var(--black);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ico {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4.5rem 1.5rem 4rem;
  text-align: center;
  border-bottom: 4px solid var(--yellow);
}

.hero__logo {
  width: 150px;
  height: 150px;
  padding: 6px;
  border: 4px solid var(--yellow);
  border-radius: 50%;
  background: var(--black);
  object-fit: cover;
}

.hero__hi {
  margin: 1.5rem 0 0.3rem;
  color: var(--grey);
  font-size: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 700;
}
.hero h1 span {
  color: var(--yellow);
}

.hero__roles {
  margin: 1rem 0 1.8rem;
  color: var(--white);
  font-size: 1.1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

/* ---------- Buttons (compact) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem 0.4rem 0.8rem;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  text-decoration: none;
  font-size: 0.8rem;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.btn b {
  font-weight: 700;
}
.btn small {
  font-size: 0.68rem;
  opacity: 0.75;
}
.btn:hover {
  background: var(--white);
  color: var(--black);
}
.btn--yellow {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--black);
}
.btn--yellow:hover {
  background: var(--black);
  color: var(--yellow);
}
.btn--black {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}
.btn--black:hover {
  background: var(--yellow);
  color: var(--black);
}
.section--white .btn--yellow {
  border-color: var(--black);
}

/* ---------- Sections ---------- */
.section {
  padding: 5rem 1.5rem;
}
.section--white {
  background: var(--white);
  color: var(--black);
}
.section--yellow {
  background: var(--yellow);
  color: var(--black);
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
}
.center {
  text-align: center;
}
.center h2 {
  margin-bottom: 1.5rem;
}

.section h2 {
  margin-bottom: 1.2rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 3.5rem;
  align-items: center;
}

.about p {
  margin: 0 0 1.5rem;
  font-size: 1.15rem;
  line-height: 1.8;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}
.facts li {
  padding-top: 0.6rem;
  border-top: 3px solid var(--black);
}
.facts span {
  display: block;
  color: #555;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ---------- About image swap: about.png -> image.png ---------- */
.about__swap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 4px solid var(--black);
  border-radius: 20px;
  background: var(--yellow);
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  transition:
    transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1),
    box-shadow 0.5s ease;
}

.about__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* شريط أصفر يسبق الصورة الثانية أثناء الكشف */
.about__swap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--yellow);
  clip-path: polygon(0 0, 0 0, -30% 100%, 0 100%);
  transition: clip-path 0.65s cubic-bezier(0.7, 0, 0.2, 1) 0.14s;
}

/* image.png: تظهر بمسح قُطري من اليسار */
.about__photo--alt {
  z-index: 2;
  clip-path: polygon(0 0, 0 0, -30% 100%, 0 100%);
  transition: clip-path 0.65s cubic-bezier(0.7, 0, 0.2, 1);
}

/* الحالة المفعّلة: hover (للماوس) أو focus (للكيبورد والموبايل) */
.about__swap:focus-visible {
  transform: translate(-6px, -6px);
  box-shadow:
    10px 10px 0 var(--yellow),
    10px 10px 0 3px var(--black);
}
.about__swap:focus-visible::before,
.about__swap:focus-visible .about__photo--alt {
  clip-path: polygon(0 0, 130% 0, 130% 100%, 0 100%);
}
.about__swap:focus-visible::before {
  transition-delay: 0s;
}
.about__swap:focus-visible .about__photo--alt {
  transition-delay: 0.14s;
}

@media (hover: hover) {
  .about__swap:hover {
    transform: translate(-6px, -6px);
    box-shadow:
      10px 10px 0 var(--yellow),
      10px 10px 0 3px var(--black);
  }
  .about__swap:hover::before,
  .about__swap:hover .about__photo--alt {
    clip-path: polygon(0 0, 130% 0, 130% 100%, 0 100%);
  }
  .about__swap:hover::before {
    transition-delay: 0s;
  }
  .about__swap:hover .about__photo--alt {
    transition-delay: 0.14s;
  }
}

/* ---------- Framework ---------- */
.fw-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.fw-head img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  cursor: pointer;
  transform-origin: 50% 90%;
  animation: fw-float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 0 rgba(255, 230, 0, 0.35));
  transition: filter 0.3s;
}
.fw-head h2 {
  margin-bottom: 0.4rem;
  color: var(--yellow);
}
.fw-head p {
  max-width: 62ch;
  margin: 0;
  color: #d6d6d6;
}
.fw-head a {
  color: var(--yellow);
}

.fw-banner {
  display: block;
  width: 100%;
  margin-bottom: 2.5rem;
  border: 3px solid var(--yellow);
  border-radius: 16px;
}

.fw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.features {
  margin: 0;
  padding: 0;
  list-style: none;
}
.features li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  color: #d6d6d6;
}
.features li:first-child {
  padding-top: 0;
}
.features b {
  color: var(--white);
}
code {
  padding: 0.1em 0.4em;
  background: #1a1a1a;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 0.85em;
}

.code {
  /* ---- Code theme: easy-to-read syntax colors ---- */
  --c-text: #e8e8e8; /* plain code */
  --c-kw: #ffe600; /* import, export, class, function, const, return */
  --c-fn: #4dd0ff; /* function names */
  --c-type: #5af5b4; /* classes, types */
  --c-str: #ffb36b; /* strings */
  --c-num: #ff7eb6; /* numbers */
  --c-prop: #c3a6ff; /* object keys / properties */
  --c-com: #6f6f6f; /* comments */
  border: 2px solid var(--white);
  border-radius: 12px;
  background: #0d0d0d;
  overflow: hidden;
}
.code__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid var(--white);
  font: 0.75rem var(--mono);
  color: var(--grey);
}
.code__bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--white);
}
.code__bar i:first-child {
  background: var(--yellow);
}
.code__bar span {
  margin-left: auto;
}
.code pre {
  margin: 0;
  padding: 1.1rem;
  overflow-x: auto;
  font: 0.82rem/1.7 var(--mono);
  color: var(--c-text);
  tab-size: 2;
}
.code code {
  padding: 0;
  background: none;
  color: var(--white);
  font-size: inherit;
}
.code ::selection {
  background: var(--yellow);
  color: var(--black);
}
.code .k {
  color: var(--c-kw);
}
.code .f {
  color: var(--c-fn);
}
.code .t {
  color: var(--c-type);
}
.code .s {
  color: var(--c-str);
}
.code .n {
  color: var(--c-num);
}
.code .p {
  color: var(--c-prop);
}
.code .c {
  color: var(--c-com);
  font-style: italic;
}

.note {
  margin: 2rem 0 0;
  color: var(--grey);
  font-size: 0.9rem;
}

/* ---------- Projects ---------- */
.project {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
  border: 3px solid var(--black);
  border-radius: 16px;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  transition: transform 0.15s;
}
.project:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 var(--white);
}
.project img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.project div {
  flex: 1;
}
.project h3 {
  color: var(--yellow);
  font-size: 1.4rem;
}
.project p {
  margin: 0.2rem 0 0;
  color: #d6d6d6;
}
.project .ico {
  width: 26px;
  height: 26px;
  color: var(--yellow);
}

/* ---------- Stack + Focus ---------- */
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 0.4rem 1rem;
  border: 2px solid var(--white);
  border-radius: 999px;
  font-weight: 500;
}
.chips li:nth-child(-n + 2) {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--black);
}

.focus {
  margin: 0;
  padding: 0;
  list-style: none;
}
.focus li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  color: var(--grey);
}
.focus li:last-child {
  border-bottom: 1px solid var(--line);
}
.focus b {
  display: block;
  color: var(--white);
  font-size: 1.05rem;
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 3rem 1.5rem 2.5rem;
  background: var(--black);
  border-top: 4px solid var(--yellow);
  text-align: center;
}
.footer p {
  margin: 0;
  font-size: 1.05rem;
}
.footer small {
  color: var(--grey);
}
.social {
  display: flex;
  gap: 0.8rem;
}
.social a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  color: var(--yellow);
  transition:
    background 0.15s,
    color 0.15s;
}
.social a:hover {
  background: var(--yellow);
  color: var(--black);
}
.social .ico {
  width: 22px;
  height: 22px;
}

/* ---------- Framework logo: swap image on hover only ---------- */
.fw-head > img:hover,
.fw-head > img:active {
  content: url("riserbob-images/fun-logo.png");
}

/* ---------- Framework logo: float + talk ---------- */
/* يطفو ويتمايل بشكل لطيف */
@keyframes fw-float {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-9px) rotate(3deg);
  }
}

/* يقفز ويتكلم */
.fw-head img:hover,
.fw-head img:active {
  animation: fw-talk 0.5s ease-in-out infinite;
}
@keyframes fw-talk {
  0%,
  100% {
    transform: translateY(0) scale(1, 1);
  }
  30% {
    transform: translateY(-12px) scale(0.95, 1.08);
  }
  60% {
    transform: translateY(0) scale(1.08, 0.92);
  }
}

.about__cta {
  margin-top: 1.8rem;
}

/* ---------- Framework logo: speech bubble on hover (CSS only) ---------- */
.fw-head::after {
  content: "Welcome to Bikini Bottom! 🍍";
  position: absolute;
  top: -16px;
  left: 62px;
  z-index: 2;
  padding: 0.35rem 0.8rem;
  border: 2px solid var(--black);
  border-radius: 14px;
  background: var(--white);
  color: var(--black);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.6);
  transform-origin: 0 100%;
  transition:
    opacity 0.25s,
    transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.fw-head:has(> img:hover)::after,
.fw-head:has(> img:active)::after {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about,
  .fw-grid,
  .two {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }
  .fw-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .section {
    padding: 3.5rem 1.2rem;
  }
  .about__swap {
    max-width: 320px;
  }
  .fw-head::after {
    left: 58px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .project,
  .social a {
    transition: none;
  }
  .about__swap,
  .about__swap::before,
  .about__photo--alt {
    transition: none;
  }
  .fw-head img,
  .fw-head img:hover,
  .fw-head img:active {
    animation: none;
  }
}
