/* ==========================================================================
   Asliddin G'oyibnazarov — portfolio
   Direction: currency-exchange rate board. Ink-navy hall, amber lamp numerals,
   ruled tabular data. Boldness spent on the board; everything else is quiet.
   ========================================================================== */

:root {
  --ink:    #0A101C;  /* hall */
  --slate:  #111A2B;  /* panel */
  --rule:   #223047;  /* hairline */
  --amber:  #FFB020;  /* lamp */
  --quote:  #3FB984;  /* up-tick */
  --paper:  #E6ECF7;  /* text */
  --muted:  #77879F;  /* labels */

  --display: 'Archivo', 'Helvetica Neue', sans-serif;
  --body:    'IBM Plex Sans', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --stack:  clamp(4.5rem, 9vw, 8rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hall lighting: one soft amber pool behind the board, nothing else. */
body::before {
  content: '';
  position: fixed;
  inset: -20% 0 auto -10%;
  height: 70vh;
  background: radial-gradient(60% 60% at 30% 30%, rgba(255, 176, 32, .09), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- shared type ------------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.eyebrow b {
  color: var(--amber);
  font-weight: 500;
}

h2.title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: -.02em;
  line-height: 1;
  margin: 0 0 2.5rem;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* --- masthead ---------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(10, 16, 28, .78);
  border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}

.mark {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .18em;
  color: var(--amber);
  text-decoration: none;
}

.nav-inline {
  display: flex;
  gap: clamp(.9rem, 2.5vw, 2rem);
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-inline a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.nav-inline a:hover { color: var(--paper); }

/* --- mobile menu ------------------------------------------------------- */
/* The toggle reads as a rate-board switch: a mono label beside three amber
   bars that collapse into a cross while the panel is open. */

.menu-toggle {
  display: none;
  align-items: center;
  gap: .7rem;
  background: transparent;
  border: 1px solid var(--rule);
  padding: .5rem .7rem;
  cursor: pointer;
  color: var(--paper);
  transition: border-color .2s;
}

.menu-toggle:hover { border-color: var(--amber); }

.menu-label {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.menu-bars {
  position: relative;
  width: 18px;
  height: 12px;
}

.menu-bars i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--amber);
  transition: transform .3s ease, opacity .2s ease, width .3s ease;
}

.menu-bars i:nth-child(1) { top: 0; }
.menu-bars i:nth-child(2) { top: 5px; width: 68%; }
.menu-bars i:nth-child(3) { top: 10px; }

.menu-toggle[aria-expanded='true'] .menu-bars i:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle[aria-expanded='true'] .menu-bars i:nth-child(2) {
  opacity: 0;
  width: 0;
}

.menu-toggle[aria-expanded='true'] .menu-bars i:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.menu-panel {
  position: fixed;
  inset: 60px 0 0;
  z-index: 19;
  background: var(--ink);
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem var(--gutter) 2.5rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .28s ease, transform .28s ease;
  overflow-y: auto;
}

.menu-panel[hidden] { display: none; }
.menu-panel.open { opacity: 1; transform: none; }

.menu-panel nav {
  display: flex;
  flex-direction: column;
}

.menu-panel nav a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--display);
  font-stretch: 112%;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--paper);
}

.menu-panel nav a .num {
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--amber);
  font-weight: 400;
}

.menu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 2rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.menu-foot a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .2rem;
}

.menu-foot a:hover { color: var(--amber); border-color: var(--amber); }

body.menu-open { overflow: hidden; }

/* --- hero: the board --------------------------------------------------- */

.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 var(--stack);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 125%;
  font-size: clamp(2.6rem, 9vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.035em;
  margin: 0 0 1.25rem;
  text-transform: uppercase;
}

.hero h1 .thin {
  display: block;
  font-weight: 200;
  color: var(--muted);
}

.lede {
  max-width: 46ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: #B7C4D8;
  margin: 0 0 2.25rem;
}

.lede strong { color: var(--paper); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-actions a {
  padding: .7rem 1.15rem;
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--paper);
  transition: border-color .2s, color .2s, background .2s;
}

.hero-actions a:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.hero-actions a.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
  font-weight: 600;
}

.hero-actions a.primary:hover {
  background: transparent;
  color: var(--amber);
}

/* board panel */

.board {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--slate), #0C1524);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--quote);
}

.live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--quote);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .25; } }

.board-scroll { overflow-x: auto; }

.board table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
}

.board th {
  padding: .7rem 1.25rem;
  text-align: left;
  font-weight: 400;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

.board td {
  padding: .95rem 1.25rem;
  border-bottom: 1px solid rgba(34, 48, 71, .55);
}

.board tr:last-child td { border-bottom: 0; }

/* Role names run in full; term and state shrink to their own content so the
   role column never has to abbreviate. */

.board th:nth-child(1),
.board td:nth-child(1) { white-space: nowrap; }

.board th:nth-child(2),
.board td:nth-child(2) { width: 100%; }

.board th:nth-child(3),
.board td:nth-child(3),
.board th:nth-child(4),
.board td:nth-child(4) {
  width: 1%;
  white-space: nowrap;
  padding-left: .9rem;
}

.board .role { color: var(--amber); letter-spacing: .04em; }
.board .org  { color: var(--paper); }
.board .term { color: var(--muted); font-size: .8rem; }

.board .state {
  text-align: right;
  color: var(--quote);
}

.board .state.past { color: var(--muted); }

/* split-flap cells */

.flap {
  display: inline-block;
  white-space: pre;
}

/* --- sections ---------------------------------------------------------- */

section {
  padding-bottom: var(--stack);
  /* clear the 60px sticky masthead, plus air, when jumped to by anchor */
  scroll-margin-top: 6rem;
}

/* education */

.edu {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.edu-main {
  background: var(--slate);
  padding: clamp(1.5rem, 3vw, 2.75rem);
}

.edu-main h3 {
  font-family: var(--display);
  font-stretch: 112%;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 .35rem;
}

.edu-degree {
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .06em;
  color: var(--amber);
  margin: 0 0 1.25rem;
}

.edu-body {
  margin: 0 0 1.5rem;
  max-width: 58ch;
  color: #B7C4D8;
  font-size: .97rem;
}

.edu-main .meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.edu-stats {
  background: var(--slate);
  margin: 0;
  padding: clamp(1.5rem, 3vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
}

.edu-stats dt {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}

.edu-stats dd {
  margin: 0;
  font-size: .92rem;
  color: var(--paper);
}

.edu-stats dd.big {
  font-family: var(--display);
  font-stretch: 112%;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--amber);
  letter-spacing: -.03em;
}

.edu-stats dd.big span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
}

/* positions ledger */

.ledger {
  border-top: 1px solid var(--rule);
}

.entry {
  display: grid;
  grid-template-columns: 8.5rem 1fr 12rem;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
  transition: background .25s;
}

.entry:hover { background: rgba(255, 176, 32, .035); }

.entry .when {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  color: var(--amber);
  letter-spacing: .04em;
  padding-top: .3rem;
}

.entry h3 {
  font-family: var(--display);
  font-stretch: 112%;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 .15rem;
  letter-spacing: -.01em;
}

.entry .org {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .06em;
  margin: 0 0 .9rem;
}

.entry ul {
  margin: 0;
  padding-left: 1.05rem;
  color: #B7C4D8;
  font-size: .95rem;
}

.entry li { margin-bottom: .35rem; }
.entry li::marker { color: var(--rule); }

.entry .tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-content: start;
  padding-top: .35rem;
}

.tag {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: .25rem .5rem;
}

/* aside roles — the short ones, kept quiet in one strip */

.aside-roles {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  line-height: 2;
}

.aside-roles b { color: #98A8C0; font-weight: 400; }

/* projects */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.project {
  background: var(--slate);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: background .25s;
}

.project:hover { background: #16233A; }

.project .host {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--amber);
  letter-spacing: .08em;
}

.project h3 {
  font-family: var(--display);
  font-stretch: 112%;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  margin: 0;
  letter-spacing: -.015em;
}

.project p {
  margin: 0;
  color: #B7C4D8;
  font-size: .95rem;
}

.project .meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

/* desks (skills) */

.desks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 2.5rem 3rem;
}

.desk h3 {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rule);
}

.desk ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .92rem;
  color: #B7C4D8;
}

.desk li {
  padding: .35rem 0;
  border-bottom: 1px solid rgba(34, 48, 71, .4);
}

.desk li:last-child { border-bottom: 0; }

/* credentials */

.cred-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
}

.cred-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .12em;
}

.cred-total b { color: var(--amber); font-weight: 500; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.75rem;
}

.filters button {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  padding: .45rem .8rem;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}

.filters button:hover { color: var(--paper); }

.filters button[aria-pressed='true'] {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 600;
}

.creds {
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .82rem;
}

.cred {
  display: grid;
  grid-template-columns: 9rem 1fr 6rem;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(34, 48, 71, .5);
  align-items: baseline;
}

.cred .issuer { color: var(--amber); letter-spacing: .05em; }
.cred .name   { color: #C3CEE0; font-family: var(--body); font-size: .95rem; }
.cred .date   { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.cred[hidden] { display: none; }

.cred-more {
  display: flex;
  gap: .6rem;
  padding-top: 1.1rem;
}

.cred-more button {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--paper);
  padding: .6rem 1rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.cred-more button:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.cred-more button[hidden] { display: none; }

.cred-more .num { color: var(--muted); }

/* closing / contact */

.close {
  border-top: 1px solid var(--rule);
  padding-top: clamp(3rem, 6vw, 5rem);
}

.close h2 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0 0 2rem;
  text-transform: uppercase;
}

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: .9rem;
}

.contact div span {
  display: block;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

.contact a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color .2s, color .2s;
}

.contact a:hover { color: var(--amber); border-color: var(--amber); }

/* beyond the desk — languages + off the clock */

.beyond {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.beyond-panel {
  background: var(--slate);
  padding: clamp(1.5rem, 3vw, 2.75rem);
}

.beyond-panel h3 {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 1.5rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--rule);
}

.beyond-panel p {
  margin: 0 0 1rem;
  max-width: 54ch;
  color: #B7C4D8;
  font-size: .97rem;
}

.beyond-panel p:last-child { margin-bottom: 0; }

.lang {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.lang dt {
  font-family: var(--display);
  font-stretch: 112%;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.lang dd {
  margin: .15rem 0 0;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--muted);
}

.lang dd .num { color: var(--quote); }

footer {
  padding: 2.5rem 0 3rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

footer a { color: var(--muted); }

/* --- reveal ------------------------------------------------------------ */

/* Two-way: elements fade in on entry and fade back out on exit, in both
   scroll directions. `data-dir` records which edge the element left by, so it
   always drifts toward the side it went out on. */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
  will-change: opacity, transform;
}

.reveal[data-dir='up'] { transform: translateY(-18px); }

.reveal.seen {
  opacity: 1;
  transform: none;
}

/* --- responsive -------------------------------------------------------- */

@media (max-width: 860px) {
  .edu, .beyond { grid-template-columns: 1fr; }
  .edu-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.75rem 2.5rem;
    /* the column layout centres vertically; in a row that would centre the
       stats horizontally, so reset it */
    justify-content: flex-start;
  }
  .entry { grid-template-columns: 1fr; gap: .75rem; }
  .entry .when { padding-top: 0; }
  .entry .tags { padding-top: .25rem; }
  .cred { grid-template-columns: 1fr; gap: .15rem; }
  .cred .date { text-align: left; }
}

@media (max-width: 820px) {
  .nav-inline { display: none; }
  .menu-toggle { display: flex; }
}

@media (max-width: 620px) {
  /* the surname is the longest word on the page — let it set the ceiling */
  .hero h1 { font-size: clamp(1.85rem, 8.4vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
