/* ==========================================================================
   Blaž Vrabec — personal site
   Monochrome, dot-matrix, one red. No frameworks, no external requests.
   ========================================================================== */

:root {
  --bg:        #0a0a0b;
  --bg-soft:   #101012;
  --line:      #232327;
  --line-soft: #1a1a1e;
  --fg:        #f4f4f6;
  --muted:     #8b8b94;
  --dim:       #5a5a63;
  --accent:    #d71921;

  --mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --display: 'Doto', 'Space Mono', ui-monospace, monospace;

  --pad: clamp(1.25rem, 5vw, 6rem);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(215, 25, 33, 0.06), transparent 55%),
    radial-gradient(circle, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px;
  background-position: 0 0, 0 0;
  background-attachment: fixed, fixed;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* A faint film-grain / scanline layer, keeps the flat black from looking dead. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.014) 0px,
    rgba(255, 255, 255, 0.014) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- nav ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(12px) saturate(140%);
}

.nav-links {
  display: flex;
  gap: clamp(0.75rem, 2.2vw, 2rem);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--muted);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.18s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.22s ease;
}

.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }

/* --------------------------------------------------------------- hero ---- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 9rem) var(--pad) clamp(3rem, 8vh, 6rem);
}

.eyebrow {
  margin: 0 0 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  color: var(--dim);
}

.hero-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 13.5vw, 11rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #dedee4 58%, #9a9aa4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 46ch;
  margin: clamp(1.75rem, 4vh, 2.75rem) 0 0;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--muted);
}

.hero-lead::first-letter { color: var(--fg); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
}

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

@keyframes pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(215, 25, 33, 0.45); }
  50%      { opacity: 0.5; box-shadow: 0 0 0 6px rgba(215, 25, 33, 0); }
}

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

.section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) var(--pad);
}

/* The rule at the top of a section draws itself in from the left as it arrives. */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-soft);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.section.ruled::before { transform: scaleX(1); }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin: 0 0 2.25rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0;
  color: var(--fg);
}

.prose { max-width: 68ch; }
.prose p { margin: 0 0 1.15rem; color: var(--muted); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--fg); font-weight: 700; }

/* One line under a section heading, saying what the section is. */
.section-lead {
  max-width: 62ch;
  margin: -1.1rem 0 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* --------------------------------------------------------------- cards ---- */

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

.card {
  padding: 1.75rem 1.5rem 2rem;
  background: var(--bg-soft);
  transition: background 0.22s ease;
}

.card h3 {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card h3::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.card:hover { background: #16161a; }

/* ---------------------------------------------------------------- tags ---- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tags li:hover {
  color: var(--fg);
  border-color: #3a3a41;
}

/* -------------------------------------------------------------- corner ---- */

/* His own mark, in the site's colours — the red dot and the white bar, the same mark as
   the tab icon — always there, as the way back to the top. */
.corner {
  display: inline-flex;
  align-items: center;
  padding: 6px;
  opacity: 0.88;
  transition: opacity 0.2s ease;
}

.corner svg { display: block; }

.corner:hover, .corner:focus-visible { opacity: 1; }

/* ---------------------------------------------------------------- now ---- */

.now {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 72ch;
  border-top: 1px solid var(--line);
}

.now li {
  position: relative;
  padding: 1.1rem 0 1.1rem 2.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}

.now li::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 1.75rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line);
}

.now strong { color: var(--fg); font-weight: 700; }

/* ------------------------------------------------------------- contact ---- */

.contact {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-soft);
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.contact-link .c-label {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--dim);
  min-width: 4.5rem;
}

.contact-link .c-value { color: var(--fg); }

.contact-link:hover { background: #16161a; }
.contact-link:hover .c-value { color: var(--accent); }

/* -------------------------------------------------------------- footer ---- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 3.5rem;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.foot a:hover { color: var(--fg); }

.foot-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line);
}

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

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ------------------------------------------------------------- entrance ---- */

/* The hero prints itself: one line crosses the name and leaves it behind. */
.print-line { position: relative; }

.hero-name { clip-path: inset(0 100% 0 0); }

.head {
  position: absolute;
  top: -6%;
  bottom: -6%;
  left: 0;
  width: 2px;
  background: var(--fg);
  box-shadow: 0 0 22px rgba(244, 244, 246, 0.5);
  opacity: 0;
  pointer-events: none;
}

.printed .hero-name { animation: print-wipe 1.25s cubic-bezier(0.3, 0.8, 0.3, 1) forwards; }
.printed .head { animation: print-head 1.25s cubic-bezier(0.3, 0.8, 0.3, 1) forwards; }

@keyframes print-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes print-head {
  0%   { left: 0; opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* One thin red line crosses the page when it loads, and is never seen again. */
.sweep {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  pointer-events: none;
  z-index: 300;
  background: linear-gradient(90deg, transparent, var(--accent) 42%, #ff7d82 50%, var(--accent) 58%, transparent);
  transform: translateX(-100%);
  animation: cross 1.15s cubic-bezier(0.45, 0, 0.15, 1) 0.25s forwards;
}

@keyframes cross { to { transform: translateX(100%); } }

/* A dim, low red light that follows the pointer. It sits at z-index -1, so it is under
   the text and behind the cards — never over anything, never over a word. */
.pointer-light {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle 400px at var(--mx, -600px) var(--my, -600px),
      rgba(215, 25, 33, 0.09), rgba(215, 25, 33, 0.03) 46%, transparent 78%);
  background-size: 100% 100%;
}

/* --------------------------------------------------------------- small ---- */

@media (max-width: 620px) {
  .nav { display: none; }
  .contact-link { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .contact-link .c-label { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse { animation: none; }
  body::after { display: none; }
  .hero-name { clip-path: none; }
  .head, .sweep, .pointer-light { display: none; }
  .section::before { transform: scaleX(1); transition: none; }
}
