/* ============================================================
   style.css  -  Yohannes's portfolio
   Every colour has a plain name. Change a colour once, here,
   and it updates everywhere on the site.
   ============================================================ */

:root {
  /* Colour names */
  --deep-red: #741b1b;
  --darkest-red: #3d0b0b;
  --soft-red: #f3e7e4;
  --gold: #c9a24b;
  --light-gold: #e3c982;
  --cream: #fbf6ea;
  --dark-text: #2b2020;
  --muted-text: #675454;
  --pale-text-on-red: #f5eaea;
  --footer-text: #ddcaca;
  --thin-red-line: rgba(61, 11, 11, 0.2);

  /* Fonts */
  --heading-font: "Fraunces", Georgia, "Times New Roman", serif;
  --body-font: "Nunito Sans", "Segoe UI", Arial, sans-serif;

  /* Sizes */
  --page-width: 1240px;
  --button-roundness: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}
body {
  font-family: var(--body-font);
  color: var(--dark-text);
  background: var(--cream);
  line-height: 1.7;
  font-size: 1.15rem;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Header: name on the left, menu top right ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--darkest-red);
  border-bottom: 2px solid var(--gold);
}
.bar {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--cream);
  text-decoration: none;
}
.nav {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition:
    border-color 0.25s,
    color 0.25s;
}
.nav a:hover {
  color: var(--light-gold);
  border-color: var(--gold);
}

/* Active menu link: when you click a menu item, its link turns gold and stays underlined.
   This uses only CSS (no JavaScript): :target is the section the link jumped to. */
body:has(#top:target) .nav a[href="#top"],
body:has(#about:target) .nav a[href="#about"],
body:has(#skills:target) .nav a[href="#skills"],
body:has(#projects:target) .nav a[href="#projects"],
body:has(#contact:target) .nav a[href="#contact"] {
  color: var(--light-gold);
  border-color: var(--gold);
}

/* ---------- Hero (top of the page) ---------- */
.hero {
  background: var(--deep-red);
  color: var(--cream);
}
.hero-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 6.5rem 1.5rem 7rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero h1 {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.hero p.lead {
  margin-top: 1.6rem;
  font-size: 1.4rem;
  max-width: 38rem;
  color: var(--pale-text-on-red);
}
.hero p.learning {
  margin-top: 1.4rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--pale-text-on-red);
}
.hero p.learning .learning-list {
  color: var(--light-gold);
}
.actions {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 1rem 1.9rem;
  border-radius: var(--button-roundness);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition:
    transform 0.2s,
    background 0.2s,
    color 0.2s;
}
.btn-gold {
  background: var(--gold);
  color: var(--darkest-red);
}
.btn-gold:hover {
  background: var(--light-gold);
  transform: translateY(-2px);
}
.btn-outline {
  border: 2px solid var(--gold);
  color: var(--cream);
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--darkest-red);
  transform: translateY(-2px);
}

/* ---------- Portrait: your photo inside a gold ring ---------- */
.portrait {
  justify-self: center;
  width: min(420px, 75vw);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
}
.portrait svg.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.portrait circle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-ring 2.2s 0.3s ease-out forwards;
}
.portrait .face {
  width: 84%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--darkest-red);
  display: grid;
  place-items: center;
  font-family: var(--heading-font);
  font-size: 7.5rem;
  font-weight: 700;
  color: var(--light-gold);
  overflow: hidden;
}
.portrait .face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- The page-load animation ---------- */
.rise {
  opacity: 0;
  transform: translateY(14px);
  animation: rise-in 0.8s ease-out forwards;
}
.rise:nth-child(1) {
  animation-delay: 0.1s;
}
.rise:nth-child(2) {
  animation-delay: 0.35s;
}
.rise:nth-child(3) {
  animation-delay: 0.6s;
}
.rise:nth-child(4) {
  animation-delay: 0.85s;
}
@keyframes rise-in {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes draw-ring {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Sections ---------- */
section {
  padding: 6rem 1.5rem;
}
.wrap {
  max-width: var(--page-width);
  margin: 0 auto;
}
h2 {
  font-family: var(--heading-font);
  font-size: clamp(2.2rem, 4.5vw, 3.1rem);
  color: var(--deep-red);
  line-height: 1.15;
  margin-bottom: 1.8rem;
}

/* About */
.about p {
  max-width: 46rem;
  margin-bottom: 1.3rem;
}
.about p.highlight {
  font-family: var(--heading-font);
  font-size: 1.6rem;
  line-height: 1.45;
  color: var(--deep-red);
  border-left: 5px solid var(--gold);
  padding-left: 1.5rem;
  margin-top: 2.2rem;
}

/* Soft red bands: "What drives my work" and "My learning path" */
.focus,
.journey {
  background: var(--soft-red);
}

/* Rows used by both "What drives my work" and "Skills" */
.rows {
  display: grid;
  grid-template-columns: 17rem 1fr;
  gap: 0;
  max-width: 58rem;
}
.rows dt,
.rows dd {
  padding: 1.4rem 0;
  border-top: 1px solid var(--thin-red-line);
}
.rows dt {
  font-family: var(--heading-font);
  font-weight: 700;
  color: var(--deep-red);
  font-size: 1.3rem;
}
.rows dd {
  color: var(--muted-text);
}
.rows > :nth-last-child(-n + 2) {
  border-bottom: 1px solid var(--thin-red-line);
}

/* My learning path: a real step-by-step line with gold markers */
.path {
  list-style: none;
  max-width: 52rem;
  position: relative;
  padding-left: 3rem;
}
.path::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 3px;
  background: var(--gold);
}
.path li {
  position: relative;
  padding-bottom: 2.6rem;
}
.path li:last-child {
  padding-bottom: 0;
}
.path li::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  left: -2.8rem;
  top: 0.25rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--soft-red);
  border: 4px solid var(--gold);
}
.path li.goal::before {
  background: var(--gold);
}
.path h3 {
  font-family: var(--heading-font);
  font-size: 1.5rem;
  color: var(--deep-red);
  line-height: 1.3;
}
.path p {
  margin-top: 0.4rem;
  color: var(--muted-text);
  max-width: 40rem;
}
.path .status {
  display: inline-block;
  margin-left: 0.8rem;
  padding: 0.1rem 0.8rem;
  border-radius: 999px;
  background: var(--light-gold);
  color: var(--darkest-red);
  font-family: var(--body-font);
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: 0.15rem;
}

/* Contact (deep red band) */
.contact {
  background: var(--deep-red);
  color: var(--cream);
}
.contact h2 {
  color: var(--cream);
}
.contact p {
  max-width: 40rem;
  color: var(--pale-text-on-red);
}
.contact p a {
  color: var(--light-gold);
  font-weight: 700;
}
.contact p.motto {
  margin-top: 1.4rem;
  font-family: var(--heading-font);
  font-size: 1.45rem;
  line-height: 1.45;
  color: var(--cream);
  border-left: 5px solid var(--gold);
  padding-left: 1.5rem;
}
.contact .links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.contact .social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.contact .social-links a {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid var(--light-gold);
  border-radius: 50%;
  color: var(--cream);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}
.contact .social-links .social-instagram {
  color: #e1306c;
  border-color: #e1306c;
}
.contact .social-links .social-facebook {
  color: #1877f2;
  border-color: #1877f2;
}
.contact .social-links .social-youtube {
  color: #ff0000;
  border-color: #ff0000;
}
.contact .social-links .social-telegram {
  color: #229ed9;
  border-color: #229ed9;
}
.contact .social-links .social-x {
  color: #000;
  background: #fff;
  border-color: #fff;
}
.contact .social-links .social-github {
  color: #181717;
  background: #f0f6fc;
  border-color: #f0f6fc;
}
.contact .social-links a:hover,
.contact .social-links a:focus-visible {
  color: #fff;
  transform: translateY(-2px);
}
.contact .social-links .social-instagram:hover,
.contact .social-links .social-instagram:focus-visible {
  background: linear-gradient(
    45deg,
    #feda75,
    #fa7e1e,
    #d62976,
    #962fbf,
    #4f5bd5
  );
  border-color: #d62976;
}
.contact .social-links .social-facebook:hover,
.contact .social-links .social-facebook:focus-visible {
  background: #1877f2;
  border-color: #1877f2;
}
.contact .social-links .social-youtube:hover,
.contact .social-links .social-youtube:focus-visible {
  background: #ff0000;
  border-color: #ff0000;
}
.contact .social-links .social-telegram:hover,
.contact .social-links .social-telegram:focus-visible {
  background: #229ed9;
  border-color: #229ed9;
}
.contact .social-links .social-x:hover,
.contact .social-links .social-x:focus-visible {
  background: #000;
  border-color: #000;
}
.contact .social-links .social-github:hover,
.contact .social-links .social-github:focus-visible {
  background: #333;
  border-color: #333;
}
.contact .social-links svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact .social-links .social-fill {
  fill: currentColor;
  stroke: none;
}
.contact .social-links .social-play {
  fill: #ff0000;
  stroke: none;
}
.contact .social-links .social-dot {
  fill: currentColor;
  stroke: none;
}

/* Footer */
footer {
  background: var(--darkest-red);
  color: var(--footer-text);
  text-align: center;
  padding: 1.6rem 1.5rem;
  font-size: 0.95rem;
  border-top: 2px solid var(--gold);
}

/* ---------- Phones and small screens ---------- */
@media (max-width: 760px) {
  body {
    font-size: 1.05rem;
  }
  section {
    padding: 4rem 1.5rem;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 3.5rem 1.5rem 4rem;
    gap: 2.5rem;
  }
  .portrait {
    order: -1;
    width: 220px;
  }
  .portrait .face {
    font-size: 4.5rem;
  }
  .rows {
    grid-template-columns: 1fr;
  }
  .rows dt {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .rows dd {
    border-top: 0;
    padding-top: 0.2rem;
  }
  .rows > :nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .rows > :last-child {
    border-bottom: 1px solid var(--thin-red-line);
  }
  .nav {
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: nowrap;
  }
  .nav a {
    font-size: 0.9rem;
    white-space: nowrap;
  }
  .site-header nav {
    flex: 1 1 100%;
  }
  .bar {
    padding: 0.75rem 1rem;
  }
  .brand {
    font-size: 1.4rem;
  }
  .path .status {
    display: table;
    margin: 0.4rem 0 0;
  }
}

/* ---------- Respect people who turn animations off ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rise {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .portrait circle {
    animation: none;
    stroke-dashoffset: 0;
  }
  .btn:hover {
    transform: none;
  }
}

/* Keep the full head and center the face in the circular portrait crop. */
.portrait .face img {
  object-position: center 50%;
}

/* Projects: one honest, focused learning-project feature */
.projects {
  background: var(--cream);
}
.projects .section-label {
  margin-bottom: 0.55rem;
  color: var(--muted-text);
  font: 700 0.75rem var(--body-font);
  letter-spacing: 0.14em;
}
.projects h2 {
  margin-bottom: 2rem;
}
.project-card {
  max-width: 58rem;
  padding: 1.5rem 1.7rem 1.2rem;
  background: #fffdf8;
  border: 1px solid var(--thin-red-line);
  border-top: 4px solid var(--gold);
  box-shadow: 0 14px 35px rgba(61, 11, 11, 0.06);
}
.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-text);
  font: 700 0.68rem var(--body-font);
  letter-spacing: 0.11em;
}
.project-status {
  color: var(--deep-red);
  white-space: nowrap;
}
.project-status i {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: 0.02rem;
}
.project-content {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.2rem;
  align-items: start;
  padding: 1.8rem 0 1.4rem;
}
.project-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--soft-red);
  color: var(--deep-red);
  font: 700 1.8rem var(--body-font);
}
.project-content h3 {
  color: var(--deep-red);
  font: 700 1.8rem/1.2 var(--heading-font);
}
.project-content p {
  max-width: 42rem;
  margin-top: 0.5rem;
  color: var(--muted-text);
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.project-tags span {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--thin-red-line);
  border-radius: 999px;
  color: var(--deep-red);
  font-size: 0.8rem;
  font-weight: 700;
}
.project-footnote {
  padding-top: 1rem;
  border-top: 1px solid var(--thin-red-line);
  color: var(--muted-text);
  font: italic 1rem var(--heading-font);
}
@media (max-width: 600px) {
  .project-card {
    padding: 1.2rem;
  }
  .project-topline {
    font-size: 0.58rem;
  }
  .project-content {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .project-icon {
    width: 2.7rem;
    height: 2.7rem;
  }
  .project-content h3 {
    font-size: 1.5rem;
  }
}

/* Fixed return-to-top control */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--darkest-red);
  color: var(--cream);
  box-shadow: 0 8px 24px rgba(61, 11, 11, 0.25);
  text-decoration: none;
  font: 700 0.8rem var(--body-font);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
}
.back-to-top.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.back-to-top span {
  color: var(--light-gold);
  font-size: 1.1rem;
  line-height: 1;
}
.back-to-top:hover {
  transform: translateY(-3px);
  background: var(--gold);
  color: var(--darkest-red);
}
.back-to-top:hover span {
  color: var(--darkest-red);
}
@media (max-width: 600px) {
  .back-to-top {
    right: 0.8rem;
    bottom: 0.8rem;
    padding: 0.65rem 0.85rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
  .back-to-top:hover {
    transform: none;
  }
}

/* Amharic typography */
html[lang="am"] body {
  font-family: "Noto Sans Ethiopic", "Nyala", sans-serif;
  letter-spacing: normal;
}
html[lang="am"] h1,
html[lang="am"] h2,
html[lang="am"] h3,
html[lang="am"] .brand,
html[lang="am"] .btn,
html[lang="am"] .path .status,
html[lang="am"] footer,
html[lang="am"] .back-to-top {
  font-family: "Noto Sans Ethiopic", "Nyala", sans-serif;
  letter-spacing: normal;
}
