/* Omar Youssef: omaryoussef.com */

:root {
  --bg: #fbfbfa;
  --fg: #111;
  --mut: #6b6b6b;
  --faint: #9d9d9a;
  --rule: #e6e6e3;
  --acc: #1d57c9;
  --ok: #2fbf71;
  --l0: #ebebe8; --l1: #c6d7f5; --l2: #8eb0ee; --l3: #4f82e3; --l4: #1d57c9;
  --tip-bg: #111; --tip-fg: #fbfbfa;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0c; --fg: #ededed; --mut: #8f8f8f; --faint: #5f5f5f; --rule: #222; --acc: #78a6ff;
    --l0: #191919; --l1: #16284a; --l2: #1f4589; --l3: #3770d6; --l4: #78a6ff;
    --tip-bg: #ededed; --tip-fg: #0c0c0c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0c; --fg: #ededed; --mut: #8f8f8f; --faint: #5f5f5f; --rule: #222; --acc: #78a6ff;
  --l0: #191919; --l1: #16284a; --l2: #1f4589; --l3: #3770d6; --l4: #78a6ff;
  --tip-bg: #ededed; --tip-fg: #0c0c0c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 Inter, system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
::selection { background: var(--acc); color: var(--bg); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 2px; }

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.meta { color: var(--faint); }
#clock::before { content: "·"; margin: 0 6px 0 4px; }

main { max-width: 760px; margin: 0 auto; padding: 88px 32px 56px; }

/* header */
.top { display: flex; align-items: center; gap: 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.name { font-weight: 550; line-height: 1.3; }
.role { color: var(--mut); font-size: 14px; line-height: 1.4; }
.domain { margin-left: auto; color: var(--faint); text-decoration: none; }
.domain:hover { color: var(--fg); }

h1 {
  font-size: clamp(25px, 4.2vw, 31px);
  line-height: 1.24;
  font-weight: 450;
  letter-spacing: -.022em;
  margin-top: 64px;
  max-width: 700px;
  text-wrap: balance;
}
h1 em { font-style: normal; color: var(--mut); display: block; }
.bio { color: var(--mut); margin-top: 22px; max-width: 580px; text-wrap: pretty; }

/* spec table */
.spec { margin-top: 48px; border-top: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}
dt.mono { color: var(--faint); text-transform: uppercase; }
dd a { text-decoration: none; border-bottom: 1px solid var(--rule); transition: border-color .15s; }
dd a:hover { border-color: var(--fg); }
.links { display: flex; gap: 18px; }
.sep { color: var(--faint); margin: 0 6px; }
.arr { color: var(--faint); font-size: .85em; display: inline-block; transition: transform .15s, color .15s; }
a:hover .arr { transform: translate(1px, -1px); color: var(--fg); }
.pulse {
  display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%;
  background: var(--ok); vertical-align: 1px; position: relative;
}
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { from { transform: scale(1); opacity: .5; } to { transform: scale(3); opacity: 0; } }
.copy { color: var(--faint); margin-left: 8px; padding: 1px 6px; border: 1px solid var(--rule); border-radius: 4px; transition: color .15s, border-color .15s; }
.copy:hover { color: var(--fg); border-color: var(--faint); }
.copy.done { color: var(--ok); border-color: var(--ok); }

/* sections */
h2 {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 19px; font-weight: 500; letter-spacing: -.01em;
  margin: 76px 0 18px;
}
h2 .mono { text-transform: uppercase; }

/* contributions */
.cal { --gap: 3px; position: relative; }
.months {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--gap);
  color: var(--faint); font-size: 10px; height: 16px; text-transform: uppercase;
}
.months span { white-space: nowrap; overflow: visible; }
.cells {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr);
  grid-auto-columns: 1fr; gap: var(--gap);
}
.cells i {
  aspect-ratio: 1; border-radius: 2px; background: var(--l0);
  transition: outline-color .1s;
  outline: 1px solid transparent; outline-offset: 1px;
}
.cells i.pad { background: none; }
.cells i[data-l="1"], .sw i[data-l="1"] { background: var(--l1); }
.cells i[data-l="2"], .sw i[data-l="2"] { background: var(--l2); }
.cells i[data-l="3"], .sw i[data-l="3"] { background: var(--l3); }
.cells i[data-l="4"], .sw i[data-l="4"] { background: var(--l4); }
.cells i:not(.pad):hover, .cells i.on { outline-color: var(--fg); }
.cal[aria-busy="true"] .cells i { animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .45; } }
.cells.in i { animation: rise .5s both; animation-delay: calc(var(--c) * 9ms); }
@keyframes rise { from { opacity: 0; transform: scale(.4); } }

.legend { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; color: var(--faint); }
.legend a { text-decoration: none; }
.legend a:hover { color: var(--fg); }
.scale { display: inline-flex; align-items: center; }
.sw { display: inline-flex; gap: 3px; margin: 0 7px; }
.sw i { width: 10px; height: 10px; border-radius: 2px; background: var(--l0); }

.tip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-fg);
  padding: 5px 8px; border-radius: 5px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
}
.tip b { font-weight: 500; }

/* experience */
.spec.exp { margin-top: 0; }
.exp .row { grid-template-columns: 150px 1fr auto; column-gap: 24px; padding: 13px 0; }
.exp b { font-weight: 500; }
.exp .desc { display: block; color: var(--mut); font-size: 14px; line-height: 1.55; margin-top: 3px; max-width: 440px; text-wrap: pretty; }
.exp .org { color: var(--mut); text-align: right; white-space: nowrap; }
.exp .org a { color: var(--fg); }

/* footer */
footer { display: flex; justify-content: space-between; align-items: center; margin-top: 96px; color: var(--faint); }
.theme { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; padding: 2px; }
.theme button { padding: 2px 8px; border-radius: 4px; color: var(--faint); transition: color .15s, background-color .15s; }
.theme button:hover { color: var(--fg); }
.theme button[aria-pressed="true"] { background: var(--l0); color: var(--fg); }

@media (max-width: 560px) {
  main { padding: 48px 20px 40px; }
  .domain { display: none; }
  h1 { margin-top: 44px; }
  .row, .exp .row { grid-template-columns: 96px 1fr; }
  .exp .row { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; }
  .exp .org { order: 1; text-align: left; font-size: 13.5px; }
  .exp dd:not(.org) { order: 2; }
  .exp dt { margin-bottom: 2px; }
  h1 em { display: inline; }
  #clock { display: block; }
  .sep { display: block; height: 0; overflow: hidden; }
  #clock::before { content: none; }
  h2 { margin-top: 60px; }
  .legend > a { display: none; }
  .legend { justify-content: flex-end; }
  footer { margin-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
