/* =========================================================
   ALI SAEBI — PORTFOLIO
   Design tokens
   ========================================================= */
:root {
  --bg: #06041f;
  --bg-panel: #0204753f;
  --bg-panel-2: #081e68;
  --bg-raise: #130a99;

  --text: #EDE8DE;
  --text-dim: #A39C8C;
  --text-faint: #6E675A;

  --gold: #ee4b4b;
  --gold-dim: #858282;
  --red: #A9342A;

  --line: #20232a;
  --line-soft: #201D18;

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ol,
ul,
dl {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* subtle film-grain overlay, purely decorative */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* =========================================================
   TOP BAR
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px var(--pad);
  background: rgba(12, 12, 14, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.mark {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold);
  letter-spacing: .02em;
  margin-right: auto;
}

.mark__logo {
  height: 50px;
  width: auto;
  display: block;
}

.tabnav {
  display: flex;
  gap: 28px;
}

.tabnav__btn {
  font-size: 14.5px;
  color: var(--text-dim);
  padding: 6px 0;
  position: relative;
  transition: color .2s var(--ease);
}

.tabnav__btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}

.tabnav__btn:hover {
  color: var(--text);
}

.tabnav__btn.is-active {
  color: var(--text);
}

.tabnav__btn.is-active::after {
  transform: scaleX(1);
}

.topbar__contact {
  font-size: 14.5px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 2px;
  transition: border-color .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}

.topbar__contact:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.navtoggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.navtoggle span {
  width: 20px;
  height: 1px;
  background: var(--text);
}

/* language switcher */
.langswitch {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px;
}

.langswitch__btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--text-faint);
  padding: 5px 10px;
  border-radius: 1px;
  transition: color .2s var(--ease), background .2s var(--ease);
}

.langswitch__btn:hover {
  color: var(--text);
}

.langswitch__btn.is-active {
  color: #151210;
  background: var(--gold);
}

/* =========================================================
   HERO
   ========================================================= */
.hero{
  position:relative;
  min-height:70vh;          /* was 88vh */
  display:flex; flex-direction:column; justify-content:center;
  padding:60px var(--pad) 80px;   /* was 120px var(--pad) 80px */
  max-width:var(--maxw); margin:0 auto;
}

.hero__timecode {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: .08em;
  margin-bottom: 28px;
}

.hero__name {
  font-size: clamp(56px, 11vw, 132px);
  line-height: .98;
  letter-spacing: -.01em;
  opacity: 0;
  transform: translateY(18px);
  animation: riseIn .8s var(--ease) .1s forwards;
}

.hero__roles {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: .04em;
}

.hero__roles span:not(:last-child)::after {
  content: "/";
  color: var(--text-faint);
  margin-left: 14px;
}

.hero__statement {
  max-width: 58ch;
  margin-top: 32px;
  font-size: 19px;
  color: var(--text-dim);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(14px);
  animation: riseIn .8s var(--ease) .3s forwards;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 40px;
  opacity: 0;
  transform: translateY(14px);
  animation: riseIn .8s var(--ease) .45s forwards;
}

.hero__location {
  margin-top: 52px;
  font-size: 13px;
  color: var(--text-faint);
  font-family: var(--mono);
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__scrollcue {
  position: absolute;
  bottom: 28px;
  left: var(--pad);
  width: 1px;
  height: 44px;
  background: var(--line);
  overflow: hidden;
}

.hero__scrollcue span {
  position: absolute;
  top: -44px;
  left: 0;
  width: 1px;
  height: 44px;
  background: var(--gold);
  animation: scrollcue 2.2s ease-in-out infinite;
}

@keyframes scrollcue {
  to {
    top: 44px;
  }
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  font-size: 14.5px;
  border-radius: 2px;
  transition: all .2s var(--ease);
  border: 1px solid transparent;
}

.btn--gold {
  background: #a70e00;
  color: #fffefd;
}

.btn--gold:hover {
  background: var(--gold);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* =========================================================
   PANELS (About / Experience / Skills / Projects)
   ========================================================= */
.panels {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.panel {
  display: none;
  padding: 64px 0 100px;
  border-top: 1px solid var(--line-soft);
}

.panel.is-active {
  display: block;
  animation: fadePanel .5s var(--ease);
}

@keyframes fadePanel {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel__heading {
  font-size: clamp(30px, 4vw, 42px);
  margin-bottom: 44px;
}

/* ABOUT */
.about {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 64px;
}

.about__paragraphs p {
  color: var(--text-dim);
  font-size: 16.5px;
  max-width: 62ch;
  margin-bottom: 18px;
}

.about__factsHeading {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-faint);
  letter-spacing: .06em;
  margin-bottom: 20px;
  text-transform: none;
}

.factlist {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.factlist .fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.factlist .fact dt {
  color: var(--text-dim);
  font-size: 14.5px;
}

.factlist .fact dd {
  margin: 0;
  font-family: var(--mono);
  color: var(--gold);
  font-size: 14.5px;
}

/* EXPERIENCE */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line-soft);
}

.timeline__item:first-child {
  padding-top: 0;
}

.timeline__period {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 14px;
  padding-top: 4px;
}

.timeline__role {
  font-family: var(--serif);
  font-size: 23px;
  margin-bottom: 4px;
}

.timeline__org {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 14px;
}

.timeline__org .dot {
  color: var(--text-faint);
  margin: 0 8px;
}

.timeline__desc {
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 64ch;
  margin-bottom: 14px;
}

.timeline__highlights {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline__highlights li {
  font-size: 14.5px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
  max-width: 64ch;
}

.timeline__highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 1px;
  background: var(--gold);
}

/* SKILLS */
.skillgroups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.skillgroup__title {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: .06em;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.skillitem {
  margin-bottom: 18px;
}

.skillitem__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14.5px;
}

.skillitem__name {
  color: var(--text);
}

.skillitem__level {
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 12.5px;
}

.skillitem__bar {
  height: 2px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.skillitem__bar span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--gold);
  width: 0;
  transition: width 1s var(--ease);
}

/* PROJECTS */
.projectgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.projectcard {
  cursor: pointer;
  border: 1px solid var(--line-soft);
  background: var(--bg-panel);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}

.projectcard:hover {
  border-color: var(--gold-dim);
}

.projectcard__thumb {
  aspect-ratio: 16/10;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-raise), var(--bg-panel-2));
  display: flex;
  align-items: center;
  justify-content: center;
}

.projectcard__thumb img,
.projectcard__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.projectcard__thumb .placeholder-label {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-faint);
  text-align: center;
  padding: 0 20px;
}

.projectcard__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 13, 12, .55), transparent 45%);
}

.projectcard__play {
  position: absolute;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(237, 232, 222, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0;
  transition: opacity .2s var(--ease);
}

.projectcard:hover .projectcard__play {
  opacity: 1;
}

.projectcard__body {
  padding: 22px;
}

.projectcard__meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold);
  margin-bottom: 8px;
}

.projectcard__title {
  font-size: 22px;
  margin-bottom: 8px;
}

.projectcard__role {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.projectcard__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.projectcard__tags span {
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 2px;
}

/* =========================================================
   CONTACT / FOOTER
   ========================================================= */
.contact {
  border-top: 1px solid var(--line-soft);
  padding: 90px var(--pad) 0;
}

.contact__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  padding-bottom: 60px;
}

.contact__heading {
  font-size: clamp(32px, 5vw, 52px);
  margin-bottom: 18px;
  max-width: 14ch;
}

.contact__sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 44ch;
  margin-bottom: 30px;
}

.contact__email {
  display: inline-block;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--gold);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 4px;
  transition: opacity .2s var(--ease);
}

.contact__email:hover {
  opacity: .75;
}

.contact__meta {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.contact__label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.contact__block span:not(.contact__label) {
  font-size: 15px;
  color: var(--text-dim);
}

.contact__socials {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact__socials a {
  font-size: 15px;
  color: var(--text-dim);
  transition: color .2s var(--ease);
  width: fit-content;
}

.contact__socials a:hover {
  color: var(--gold);
}

.contact__foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-faint);
  font-family: var(--mono);
}

/* =========================================================
   MODAL
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, .86);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  max-width: 920px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  animation: modalIn .3s var(--ease);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  background: rgba(14, 13, 12, .7);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__media {
  width: 100%;
  background: #000;
}

.modal__media img,
.modal__media video,
.modal__media iframe {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: none;
}

.modal__media .modal__thumbnails {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--bg-panel-2);
  overflow-x: auto;
}

.modal__media .modal__thumbnails button {
  flex: 0 0 auto;
  width: 72px;
  height: 44px;
  overflow: hidden;
  opacity: .55;
  border: 1px solid transparent;
}

.modal__media .modal__thumbnails button.is-active {
  opacity: 1;
  border-color: var(--gold);
}

.modal__media .modal__thumbnails img,
.modal__media .modal__thumbnails video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
}

.modal__body {
  padding: 32px;
}

.modal__meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold);
}

.modal__title {
  font-size: 28px;
  margin: 10px 0 14px;
}

.modal__desc {
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 64ch;
  margin-bottom: 18px;
}

.modal__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.modal__tags span {
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 2px;
}

.modal__link {
  display: inline-block;
  margin-top: 16px;
  color: var(--gold);
  font-size: 14.5px;
  border-bottom: 1px solid var(--gold-dim);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .tabnav {
    display: none;
  }

  .topbar__contact {
    display: none;
  }

  .navtoggle {
    display: flex;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .skillgroups {
    grid-template-columns: 1fr 1fr;
  }

  .projectgrid {
    grid-template-columns: 1fr;
  }

  .contact__inner {
    grid-template-columns: 1fr;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .skillgroups {
    grid-template-columns: 1fr;
  }

  .contact__foot {
    flex-direction: column;
    gap: 6px;
  }
}

/* mobile nav drawer, injected state via JS */
.tabnav.is-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 16px var(--pad);
  gap: 4px;
  z-index: 99;
}

.tabnav.is-open .tabnav__btn {
  padding: 14px 0;
  font-size: 17px;
}

/* focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}