/* ==========================================================================
   Domagoj Žugec — personal site
   Single stylesheet. No build step, no dependencies, no JavaScript.
   Sections: tokens · reset · layout · type · header · hero · cards ·
             case studies · callout · contact · footer · print
   ========================================================================== */

/* --- tokens --------------------------------------------------------------- */

:root {
  --paper:      #faf9f7;
  --paper-2:    #f3f1ed;
  --ink:        #17191d;
  --ink-2:      #4e535d;
  --ink-3:      #7d838f;
  --rule:       #e3dfd8;
  --accent:     #1c5c4d;
  --accent-ink: #12433a;
  --accent-bg:  #e9f0ed;

  --font-sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter,
                Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Source Serif 4", Georgia,
                "Times New Roman", serif;
  --font-mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                "Liberation Mono", monospace;

  --shell:  68rem;   /* page gutter width   */
  --prose:  36rem;   /* comfortable measure */

  --step-0: 1.0625rem;
  --step-1: clamp(1.15rem, 0.4vw + 1.05rem, 1.3rem);
  --step-2: clamp(1.4rem,  0.9vw + 1.2rem,  1.75rem);
  --step-3: clamp(1.75rem, 1.6vw + 1.35rem, 2.4rem);
  --step-4: clamp(2.2rem,  3.4vw + 1.35rem, 3.6rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #101215;
    --paper-2:    #171a1f;
    --ink:        #e9e7e3;
    --ink-2:      #a8aeb9;
    --ink-3:      #767c88;
    --rule:       #272b32;
    --accent:     #6dc1a6;
    --accent-ink: #8ed4bc;
    --accent-bg:  #15231f;
  }
}

/* --- reset ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 2rem;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first last;
}

img, svg { display: block; max-width: 100%; }
ul { padding: 0; list-style: none; }

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* --- layout --------------------------------------------------------------- */

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--rule);
}

.prose { max-width: var(--prose); }
.prose > * + * { margin-top: 1rem; }

.stack > * + * { margin-top: 1.5rem; }

/* sticky section label on the left, content on the right */
.split {
  display: grid;
  gap: 1.75rem clamp(2rem, 6vw, 5rem);
}
@media (min-width: 56rem) {
  .split { grid-template-columns: 11rem 1fr; }
  .split > .split-label { position: sticky; top: 2.5rem; align-self: start; }
}

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); letter-spacing: -0.028em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 42rem;
  text-wrap: pretty;
}

.muted { color: var(--ink-2); }
.small { font-size: 0.925rem; }

/* --- header --------------------------------------------------------------- */

.site-header {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.site-header .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: underline; text-underline-offset: 0.2em; }

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }

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

.hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem); }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 1.5rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
  padding: 0.35rem 0.8rem 0.35rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.btn:hover { background: transparent; color: var(--ink); }

.btn-quiet {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
}
.btn-quiet:hover { border-color: var(--ink); background: transparent; color: var(--ink); }

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

.grid-3 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper-2);
}
.card h3 {
  margin-top: 0.75rem;
  font-size: 1.2rem;
  line-height: 1.25;
}
.card p {
  margin-top: 0.65rem;
  font-size: 0.95rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* --- work teasers (home) -------------------------------------------------- */

.teasers {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border-block: 1px solid var(--rule);
}

.teaser {
  display: block;
  padding: 1.75rem 0;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}
.teaser:hover { background: var(--paper-2); }
.teaser:hover h3 { text-decoration: underline; text-underline-offset: 0.15em; }
.teaser h3 { font-size: var(--step-2); max-width: 26ch; }
.teaser p { margin-top: 0.6rem; color: var(--ink-2); max-width: 46rem; text-wrap: pretty; }
.teaser .eyebrow { display: block; margin-bottom: 0.6rem; }
.teaser .more {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-ink);
}

/* --- case studies --------------------------------------------------------- */

.case { padding-block: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--rule); }
.case > h2 { max-width: 22ch; }
.case > .eyebrow { display: block; margin-bottom: 0.75rem; }

.case-body { margin-top: 2.5rem; }
.case-body > * + * { margin-top: 2.25rem; }

.case-part > h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.4;
}
.case-part > * + * { margin-top: 0.9rem; }
.case-part p { max-width: 40rem; text-wrap: pretty; }

.bullets { margin-top: 1.1rem; max-width: 40rem; }
.bullets li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--ink-2);
  text-wrap: pretty;
}
.bullets li + li { margin-top: 0.7rem; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.72em;
  width: 0.4rem;
  height: 1px;
  background: var(--ink-3);
}

.subhead { font-weight: 600; color: var(--ink); }

/* the closing "what it means" block carries the offer, so it gets the weight */
.case-part.pitch {
  padding: 1.5rem 1.75rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 4px 4px 0;
}
.case-part.pitch p { color: var(--ink); }

/* --- callout -------------------------------------------------------------- */

.callout {
  padding: 1.75rem;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  background: var(--paper-2);
  max-width: 44rem;
}
.callout > * + * { margin-top: 0.85rem; }
.callout .eyebrow { display: block; }
.callout p { text-wrap: pretty; }

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

.contact-list { margin-top: 0.5rem; }
.contact-list > div + div { margin-top: 1.5rem; }
.contact-list dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}
.contact-list dd {
  margin: 0;
  font-size: var(--step-1);
  font-family: var(--font-serif);
  word-break: break-word;
}

.checklist { margin-top: 1rem; max-width: 40rem; }
.checklist li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink-2);
  text-wrap: pretty;
}
.checklist li + li { margin-top: 0.6rem; }
.checklist li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--accent);
}

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

.site-footer {
  padding-block: 2.5rem 3.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 0.9rem;
}
.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-links { display: flex; gap: 1.25rem; }

/* --- print ---------------------------------------------------------------- */

@media print {
  :root {
    --paper: #fff; --paper-2: #fff; --ink: #000;
    --ink-2: #333; --ink-3: #555; --rule: #ccc; --accent-bg: #fff;
  }
  body { font-size: 10.5pt; }
  .site-header, .site-footer, .actions, .skip-link, .status { display: none; }
  .section, .case { break-inside: avoid-page; padding-block: 1.25rem; }
  a { text-decoration: none; color: #000; }
  .case-part.pitch, .callout { border: 1px solid #999; }
}
