/* Matěj Šulc — matejsulc.eu
   Papír, inkoust a jeden oranžový háček. Bez frameworku. */

@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* barvy z loga: tmavé pozadí, světlý text, oranžový akcent */
  --paper:   #0a0a0a;
  --paper-2: #151514;
  --ghost:   #141413;
  --line:    #262624;
  --ink:     #f5f5f2;
  --ink-2:   #d6d6d1;
  --muted:   #8f8f8a;
  --accent:  #ff5b1f;

  --night:       #0a0a0a;
  --night-ghost: #141413;
  --night-line:  #2a2a28;
  --night-text:  #f5f5f2;
  --night-muted: #a2a2a0;

  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 78rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header: 4.25rem;
  --ease: cubic-bezier(.22, 1, .36, 1);

}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.6;
  letter-spacing: .008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* patička vždy dole, i na krátkých stránkách */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

::selection { background: var(--accent); color: #0a0a0a; }

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: .75rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
}
.skip:focus { left: var(--gutter); }

.muted { color: var(--muted); }

/* ---------- drobnosti ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  height: 3.25rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-sm { height: 2.5rem; padding: 0 1.1rem; font-size: .9rem; }

.btn-ink { background: var(--accent); color: #0a0a0a; }
.btn-ink:hover { background: var(--ink); color: #0a0a0a; }

.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.btn-line-night { background: transparent; color: #0a0a0a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.btn-line-night:hover { box-shadow: inset 0 0 0 1px #0a0a0a; }
.btn-line-night.is-done { background: #0a0a0a; color: var(--accent); }

.linklike {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: .2em;
}
.linklike:hover { text-decoration-color: var(--accent); }

/* ---------- hlavička ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(10, 10, 10, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
          backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--header);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}
.brand-mark { width: 2.1rem; height: auto; color: var(--ink); }
.brand-name { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.025em; }

.nav {
  display: none;
  gap: 1.75rem;
  margin-left: auto;
  font-size: .95rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.nav a:hover { color: var(--ink); }

.status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  padding: .4rem .8rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  transition: box-shadow .2s;
}
.status:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.status i {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--accent);
}

@media (min-width: 760px) {
  .nav { display: flex; }
  .status { margin-left: 0; }
}

/* ---------- úvod ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: clamp(4rem, 14vh, 9rem);
  padding-bottom: clamp(4rem, 10vh, 7rem);
}

/* velké „Ms“ v pozadí, stejně jako v banneru */
.hero-mark {
  position: absolute;
  z-index: -1;
  /* zarovnané s pravým okrajem obsahu */
  right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  top: 50%;
  transform: translateY(-50%);
  width: clamp(18rem, 32vw, 30rem);
  height: auto;
  color: var(--ghost);
  pointer-events: none;
}

@media (max-width: 759px) {
  .hero-mark { display: none; }
}

.hero h1 {
  margin: 0 0 clamp(1.5rem, 3vh, 2.25rem);
  max-width: 12ch;
  font-size: clamp(3rem, 8.5vw, 7rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -0.045em;
}

.lead {
  max-width: 46ch;
  margin: 0;
  font-size: clamp(1.1rem, 1rem + .45vw, 1.375rem);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: clamp(2rem, 4vh, 2.75rem);
}

/* ---------- sekce ---------- */

.section { padding-block: clamp(4.5rem, 11vh, 8rem); }
.section + .section { border-top: 1px solid var(--line); }

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2.sec-title { margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.about h2.sec-title { margin-bottom: 0; }

/* ---------- projekty ---------- */

.work {
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem) clamp(1.25rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* po dvou vedle sebe, lichý poslední přes celou šířku */
@media (min-width: 760px) {
  .work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .project:last-child:nth-child(odd) .shot { aspect-ratio: 16 / 7; }
}

.project { position: relative; }

.shot {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .8s var(--ease);
}

.project h3 {
  margin: 0;
  margin-top: 1.1rem;
  font-size: clamp(1.2rem, 1.1rem + .4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.project h3 a { text-decoration: none; }
/* celá karta je klikací, ale odkaz je jen jeden */
.project h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.p-desc {
  max-width: 48ch;
  margin: .35rem 0 0;
  color: var(--muted);
}

.p-stack { margin: .35rem 0 0; font-size: .875rem; color: var(--muted); }

@media (hover: hover) {
  .project:hover .shot img { transform: scale(1.03); }
  .project:hover h3 a { color: var(--accent); }
}

.project:focus-within .shot { box-shadow: 0 0 0 2px var(--accent); }
.project h3 a:focus-visible { outline: none; }

/* ---------- služby ---------- */

.services {
  display: grid;
  gap: 2rem 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.services h3 {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.services p { margin: 0; max-width: 34ch; color: var(--muted); }

@media (min-width: 900px) {
  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* hosting a partnerský odkaz pod službami */
.hosting {
  display: grid;
  gap: 1rem 2rem;
  margin-top: clamp(3rem, 7vh, 4.5rem);
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--paper-2);
}

.hosting h3 {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.hosting-text p { margin: 0; max-width: 52ch; }
.hosting-text .hosting-note {
  margin-top: .6rem;
  font-size: .85rem;
  color: var(--muted);
}

.hosting-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}
.hosting-actions .btn-line { box-shadow: inset 0 0 0 1px var(--ink); }
.hosting-actions .btn-line:hover { background: var(--ink); color: var(--paper); }

.code {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color .2s;
}
.code:hover, .code.is-done { border-color: var(--accent); }
.code-label {
  font-size: .75rem;
  color: var(--muted);
}
.code-value { font-family: var(--mono); font-weight: 600; letter-spacing: .04em; }

@media (min-width: 900px) {
  .hosting {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 1.75rem 2rem;
  }
  .hosting-actions { align-self: center; }
}

/* ---------- o mně ---------- */

.about {
  display: grid;
  gap: 2rem 4rem;
}

.about-text > p {
  max-width: 52ch;
  margin: 0 0 1.25em;
  font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  line-height: 1.5;
}

@media (min-width: 900px) {
  .about { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

/* ---------- kontakt (tmavý, jako logo) ---------- */

.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(5rem, 14vh, 9rem);
  background: var(--accent);
  color: #0a0a0a;
}

.contact-mark {
  position: absolute;
  z-index: -1;
  right: -10vw;
  bottom: -18%;
  width: clamp(24rem, 62vw, 60rem);
  height: auto;
  color: rgba(0, 0, 0, .07);
  pointer-events: none;
}

.contact h2 {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: .98;
  letter-spacing: -0.045em;
}

.mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.mail-big {
  font-size: clamp(1.5rem, 4.6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(#0a0a0a, #0a0a0a) 0 100% / 0 3px no-repeat;
  padding-bottom: .08em;
  transition: background-size .5s var(--ease);
}
.mail-big:hover, .mail-big:focus-visible { background-size: 100% 3px; }

.contact-note {
  max-width: 40ch;
  margin: 1.5rem 0 0;
  color: rgba(0, 0, 0, .7);
}

/* ---------- patička ---------- */

.site-footer {
  background: var(--night);
  color: var(--night-muted);
  font-size: .9rem;
}

.site-footer .wrap {
  display: grid;
  gap: 1.5rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--night-line);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--night-text);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.foot-brand b { color: var(--accent); }
.foot-mark { width: 1.9rem; height: auto; color: var(--night-text); }

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a { text-decoration: none; transition: color .2s; }
.foot-links a, .foot-legal a, .foot-legal .linklike {
  text-decoration: underline;
  text-decoration-color: var(--night-line);
  text-underline-offset: .25em;
}
.site-footer a:hover, .site-footer .linklike:hover { color: var(--night-text); }

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 0;
  font-size: .82rem;
}

@media (min-width: 900px) {
  .site-footer .wrap {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2.5rem;
  }
  .foot-links { justify-content: center; }
}

/* ---------- cookie lišta ---------- */

.consent {
  position: fixed;
  z-index: 50;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 1rem;
  max-width: 27rem;
  padding: 1.25rem;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(0, 0, 0, .6);
  font-size: .92rem;
  line-height: 1.5;
}
.consent[hidden] { display: none; }
.consent p { margin: 0; }
.consent strong { display: block; margin-bottom: .2rem; font-weight: 600; }
.consent a { color: var(--muted); text-underline-offset: .2em; }

.consent-actions {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
}
.consent-actions .btn { flex: 1; }

/* ---------- textové stránky (soukromí, 404) ---------- */

.page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(3.5rem, 10vh, 7rem) clamp(4rem, 12vh, 8rem);
}

.page h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -0.05em;
}

.prose { max-width: 44rem; }
.prose h2 {
  margin: 3rem 0 .9rem;
  font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.prose p, .prose ul { margin: 0 0 1rem; color: var(--ink-2); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--muted); }
.prose a { text-underline-offset: .2em; text-decoration-color: var(--muted); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose .lead { margin-bottom: 2rem; }
.prose table {
  width: 100%;
  margin: 0 0 1rem;
  border-collapse: collapse;
  font-size: .92rem;
}
.prose th, .prose td {
  padding: .6rem .75rem .6rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th { font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .85em; }

.notfound .hero-mark { top: auto; bottom: -20%; }
.notfound .hero-actions { margin-top: 2rem; }

/* ---------- pohyb ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

@media print {
  .site-header, .consent, .hero-mark, .contact-mark, .hero-actions { display: none !important; }
  .contact, .site-footer { background: none; color: var(--ink); }
}
