/* eminbudak.com — one screen, monochrome, terminal. */

:root {
  --bg: #0a0a0a;
  --bg-2: #101010;
  --fg: #ececec;
  --mid: #b3b3b3;
  --dim: #7d7d7d;
  --shade: #585858;
  --faint: #3a3a3a;
  --line: #1c1c1c;

  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs: clamp(11px, min(1.02vw, 1.55vh), 19px);
  --lh: 1.5;
  --pad-x: clamp(16px, 3.2vw, 64px);
  --pad-y: clamp(10px, 2.4vh, 40px);
  --bar-h: calc(var(--fs) * 2.25);
  --vh: 100dvh;
}

:root[data-theme="light"] {
  --bg: #f3f3f1;
  --bg-2: #ebebe9;
  --fg: #121212;
  --mid: #3d3d3d;
  --dim: #686868;
  --shade: #9a9a9a;
  --faint: #c4c4c2;
  --line: #dededc;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs) / var(--lh) var(--font);
  font-variant-ligatures: none;
  font-feature-settings: "zero" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[hidden] { display: none !important; }

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ frame */

.term {
  height: 100vh;
  height: var(--vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(120% 90% at 28% 42%, color-mix(in srgb, var(--fg) 3%, transparent) 0%, transparent 62%),
    var(--bg);
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--bar-h);
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: .84em;
  white-space: nowrap;
}
.lights { display: flex; gap: .6em; }
.lights i { width: .8em; height: .8em; border: 1px solid var(--faint); border-radius: 50%; }
.title .sep { color: var(--faint); }
.host { justify-self: end; display: flex; gap: 2.2ch; color: var(--dim); }
.host a { text-decoration: none; }
.host a:hover { color: var(--fg); }

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2ch;
  height: var(--bar-h);
  padding: 0 var(--pad-x);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--dim);
  font-size: .84em;
  white-space: nowrap;
}
.tabs { display: flex; align-items: center; gap: 1.2ch; }
.session-name { color: var(--mid); }
.win { padding: 0 .6ch; }
.win:hover { color: var(--fg); }
.win.is-active { background: var(--fg); color: var(--bg); }
.hint kbd {
  font: inherit;
  color: var(--fg);
  padding: 0 .5ch;
  border: 1px solid var(--faint);
}
.clock-city { color: var(--dim); }
.clock-city + time + .clock-city { margin-left: 1.2ch; }
.clock time { color: var(--mid); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ screen */

.screen {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 32fr) minmax(0, 68fr);
  gap: clamp(16px, 3.2vw, 72px);
  padding: var(--pad-y) var(--pad-x);
}

/* left column: the portrait, centred and still while the session scrolls */
.side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.portrait {
  position: relative;
  flex: none;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
}
#portrait {
  margin: 0;
  font: inherit;
  font-size: 9px; /* fitted to the box by site.js */
  line-height: 1;
  letter-spacing: 0;
  color: color-mix(in srgb, var(--fg) 80%, var(--bg));
  white-space: pre;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 56%, rgba(0, 0, 0, .35) 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 56%, rgba(0, 0, 0, .35) 82%, transparent 100%);
}

.session {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.session::-webkit-scrollbar { display: none; }
.scroll { margin-block: auto; padding-bottom: .2em; }

/* ------------------------------------------------------------ lines */

.line { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
h2.line { font: inherit; }
.gap { margin-top: .95em; }
.gap.gap-lg { margin-top: 1.9em; }
.dim { color: var(--dim); }
.dot { color: var(--faint); }
.ps1 { color: var(--dim); white-space: nowrap; }
.ps1 b { color: var(--fg); font-weight: 700; }
.typed { color: var(--fg); }
.is-typing .typed::after,
.cursor-inline::after {
  content: " ";
  display: inline-block;
  width: 1ch;
  background: var(--fg);
}

.out { margin: .3em 0 0; }
.out a,
.history a {
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: .22em;
}
.out a:hover,
.history a:hover,
.links a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

.name { margin: .55em 0 .6em; font-size: 1em; font-weight: 400; line-height: 1; }
.banner { display: block; width: min(100%, 38em); height: auto; overflow: visible; }
.banner-blocks { fill: url(#banner-px); }
.banner-px { fill: var(--fg); }
.banner-shadow { stroke: var(--shade); }

.lead { margin: 0; font-size: 1.14em; font-weight: 500; letter-spacing: -.01em; }
.lead a { text-decoration-color: var(--dim); }
.mid { margin: .15em 0 0; color: var(--mid); }

.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 2.5ch;
}
.kv > div { display: contents; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }

.log { list-style: none; margin-bottom: 0; padding: 0; }
.log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log li::before { content: "* "; color: var(--dim); }
.sha { color: var(--shade); }
.ref { color: var(--fg); font-weight: 700; }
.yr { color: var(--dim); }
.log b { font-weight: 700; }

.links { display: flex; flex-wrap: wrap; column-gap: 3.2ch; row-gap: .1em; }
.links a { padding: 0 .15ch; margin: 0 -.15ch; }
.links .dir { font-weight: 700; }

/* press coverage as releases: hover (or tap) a tag for the clipping */
.releases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(32ch, 1fr)); column-gap: 2ch; }
.rel {
  font: inherit; color: inherit; background: none; border: 0; border-radius: 0;
  padding: 0 .15ch; margin: 0 -.15ch; text-align: left; white-space: nowrap; cursor: default;
  text-decoration: underline dotted var(--faint); text-underline-offset: .25em;
}
.rel b { font-weight: 700; }
.rel .n { color: var(--dim); }
.rel:hover .n, .rel:focus-visible .n, .rel[aria-expanded="true"] .n { color: inherit; }
.rel:hover, .rel:focus-visible, .rel[aria-expanded="true"] { background: var(--fg); color: var(--bg); text-decoration: none; outline: none; }
.latest { margin-left: .6ch; padding: 0 .6ch; border: 1px solid currentColor; font-size: .82em; }

.relcard {
  position: fixed; z-index: 30;
  width: min(23em, calc(100vw - 24px));
  padding: .85em 1em .95em;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 1.2em 3em rgba(0, 0, 0, .45);
  font-size: .9em; line-height: 1.45;
}
.relcard[hidden] { display: none; }
.rc-cmd { margin: 0 0 .6em; color: var(--dim); }
.rc-img { position: relative; margin: 0 0 .7em; height: 11em; overflow: hidden; border: 1px solid var(--line); background: color-mix(in srgb, var(--fg) 6%, var(--bg)); }
.rc-count { position: absolute; left: .4em; bottom: .35em; max-width: calc(100% - .8em); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .6ch; background: color-mix(in srgb, var(--bg) 84%, transparent); color: var(--fg); font-size: .82em; pointer-events: none; }
.rc-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: grayscale(1) contrast(1.08); transition: filter .3s ease; }
.rc-img:hover img { filter: none; }
.rc-title { margin: 0; font-weight: 700; }
.rc-meta { margin: .15em 0 .55em; color: var(--dim); }
.rc-links { margin: 0; color: var(--dim); }
.rc-links a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: .2em; }
.rc-links a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }
.rc-links a.clip { text-decoration-style: dotted; }
.relnotes p { margin: 0; }
.rc-img { cursor: zoom-in; }

/* the clippings viewer: a terminal window over the page */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(10px, 3vw, 48px);
  background: color-mix(in srgb, #000 74%, transparent);
  animation: lb-in .18s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-open .relcard { display: none; }
.lb-win {
  width: min(1180px, 100%); height: 100%;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 2em 6em rgba(0, 0, 0, .6);
}
.lb-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2ch;
  height: var(--bar-h); padding: 0 1.2em; border-bottom: 1px solid var(--line);
  color: var(--dim); font-size: .84em; white-space: nowrap;
}
.lb-title { text-align: center; overflow: hidden; text-overflow: ellipsis; }
.lb-x { font: inherit; color: var(--dim); background: none; border: 1px solid var(--line); padding: 0 .8ch; cursor: pointer; }
.lb-x:hover, .lb-x:focus-visible { background: var(--fg); color: var(--bg); outline: none; }
.lb-stage {
  position: relative; margin: 0; min-height: 0; overflow: hidden;
  background: color-mix(in srgb, var(--fg) 4%, var(--bg));
}
.lb-img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: contain; cursor: zoom-in; transition: opacity .2s ease;
}
.lightbox.is-loading .lb-img { opacity: .35; }
.lb-stage.is-zoomed { overflow: auto; }
.lb-stage.is-zoomed .lb-img { position: static; width: auto; height: auto; max-width: 100%; margin: 0 auto; cursor: zoom-out; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: 2em; line-height: 1; padding: .15em .45em;
  color: var(--fg); background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--line); cursor: pointer;
}
.lb-stage.is-zoomed .lb-nav { display: none; }
.lb-prev { left: .6em; }
.lb-next { right: .6em; }
.lb-nav:hover, .lb-nav:focus-visible { background: var(--fg); color: var(--bg); outline: none; }
.lb-info { padding: .8em 1.2em .7em; border-top: 1px solid var(--line); line-height: 1.5; }
.lb-info p { margin: 0; }
.lb-where { color: var(--dim); }
.lb-where b { color: var(--fg); }
.lb-head { margin-top: .35em; }
.lb-en { color: var(--dim); }
.lb-links { margin-top: .45em; }
.lb-links a { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: .2em; }
.lb-links a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }
.lb-foot {
  display: flex; justify-content: space-between; gap: 2ch;
  padding: .35em 1.2em; border-top: 1px solid var(--line);
  color: var(--dim); font-size: .84em; font-variant-numeric: tabular-nums;
}
.relnotes .rc-links { margin: .1em 0 .4em; }

/* ------------------------------------------------------------ prompt */

.prompt { display: flex; gap: 1ch; cursor: text; white-space: normal; }
.prompt .ps1 { flex: none; }
.input-wrap { position: relative; flex: 1; min-width: 0; white-space: nowrap; }
#cmd {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: 400 16px/1 var(--font); /* 16px keeps iOS from zooming in on focus */
  opacity: 0;
  outline: none;
}
.mirror { white-space: pre; }
.cursor { display: inline-block; min-width: 1ch; outline: 1px solid var(--fg); outline-offset: -1px; }
.prompt.is-focused .cursor {
  outline: 0;
  background: var(--fg);
  color: var(--bg);
  animation: blink 1.1s steps(1, end) infinite;
}
@keyframes blink { 50% { background: transparent; color: var(--fg); } }

.history .line { color: var(--fg); }
.history .cmd { margin-top: .6em; }
.history .err { color: var(--mid); }
.history .grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 3ch;
}
.history .grid span:nth-child(odd) { color: var(--fg); font-weight: 700; }
.history .grid span:nth-child(even) { color: var(--dim); }
.history p { margin: .35em 0 0; max-width: 78ch; }
.swatches { display: flex; gap: .6ch; margin-top: .4em; }
.swatches i { width: 2.4ch; height: 1em; }

/* ------------------------------------------------------------ intro */

.js .step { visibility: hidden; }
.js .step.is-shown,
.js.intro-done .step { visibility: visible; }

.js .banner { clip-path: inset(0 100% 0 0); }
.js .is-shown .banner { clip-path: inset(0 0 0 0); transition: clip-path .8s steps(91, end); }
.js.intro-done .banner { clip-path: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  .js .step { visibility: visible; }
  .js .banner { clip-path: none; }
  .prompt.is-focused .cursor { animation: none; }
}

/* ------------------------------------------------------------ sizes */

/* short desktop windows: drop the lines that matter least */
@media (min-width: 861px) and (max-height: 700px) {
  .hide-compact { display: none; }
  .gap { margin-top: .7em; }
  .gap.gap-lg { margin-top: 1.5em; }
}

/* phones and portrait tablets: portrait on top, the short version of the story below */
@media (max-width: 860px), (max-aspect-ratio: 4/5) {
  :root { --fs: clamp(11px, min(3.1vw, 2.1vh), 16px); --lh: 1.5; }
  .screen { display: flex; flex-direction: column; gap: .6em; }
  .lightbox { padding: 0; }
  .lb-win { border: 0; }
  .lb-keys { display: none; }
  .lb-nav { font-size: 1.5em; }
  /* on a phone the portrait is centred in the space above the session */
  .side { display: contents; }
  .portrait { flex: 1 1 0; min-height: 22vh; display: flex; align-items: center; justify-content: center; }
  #portrait { flex: none; }
  .session { flex: 0 1 auto; }
  .scroll { margin-block: 0; }
  .hide-mobile, #last-login { display: none !important; }
  .hint, .host { display: none; }
  .titlebar { grid-template-columns: auto minmax(0, 1fr); gap: 2ch; }
  .title { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .name { margin: .3em 0 .45em; }
  .lead { font-size: 1.05em; }
  .gap { margin-top: .7em; }
  .gap.gap-lg { margin-top: 1.5em; }
}
