/* Peter Durica, portfolio
   Black and dark blue, one face, one blue accent on the handle and the action. No pictures. */

:root {
  --bg: #03060d;
  --ink: #e8eef9;
  --muted: #97a6c1;
  --accent: #2004dd;
  /* other blues, only where something has to read as different: a hover fill, and a light blue for
     link text on dark grounds, where #2004dd itself would be too dark to read */
  --accent-hover: #3a22ec;
  --accent-light: #a3b2ff;
  --accent-ink: #f2f6fd;

  --field: #071433;
  --band: #081330;
  --footer: #0a1a40;
  --footer-muted: #a9b6cf;

  --font: "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.375rem, 1rem + 1.3vw, 2rem);
  --step-head: clamp(2.25rem, 1.4rem + 2.6vw, 3.5rem);
  --step-row: clamp(2.5rem, 1.2rem + 4.6vw, 5.375rem);

  --margin: clamp(1.25rem, 2vw, 1.75rem);
  --gutter: clamp(1rem, 2vw, 1.75rem);
  --section: clamp(6rem, 10vw, 9rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.5; font-kerning: normal; -webkit-font-smoothing: antialiased; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: 1rem; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: var(--margin); top: -4rem; z-index: 10; padding: 0.75rem 1rem; background: var(--ink); color: var(--bg); text-decoration: none; }
.skip:focus { top: var(--margin); }

.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.08em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration-color: currentColor; } }

.button, .cell {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0 1.6rem;
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.button { background: var(--accent); color: var(--accent-ink); }
.cell { background: var(--ink); color: var(--bg); }
.button:active, .cell:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-hover); }
  .cell:hover { background: #ffffff; }
}

/* ---------- hero: the name and handle, centred; the handle runs margin to margin below ---------- */
/* the intro sits centred in the space between the bar and the visible part of the handle */
.hero {
  position: relative; height: 100svh; min-height: 36rem; overflow: hidden;
  display: flex; flex-direction: column;
  padding: var(--margin) var(--margin) calc((100vw - 2 * var(--margin)) / 3.95 * 0.62);
}
.hero__bar { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.wordmark { font-weight: 500; text-decoration: none; }
.hero__nav { display: flex; gap: 1.75rem; }
.menu-toggle { display: none; font-weight: 500; }

.hero__intro {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin: auto;
}
.hero__sentence { max-width: 30ch; font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.015em; font-weight: 500; text-wrap: balance; }
.hero__intro .button { margin-top: 2.25rem; }

/* The line box is shorter than the letters, so the box ends at the bottom of the screen while the
   feet of the letters run past it and are cut. */
.monument {
  position: absolute; left: 50%; bottom: 0; z-index: 1;
  font-size: calc((100vw - 2 * var(--margin)) / 3.95);
  font-weight: 700; line-height: 0.56; letter-spacing: -0.05em;
  color: var(--accent); white-space: nowrap; pointer-events: none;
  /* the last letter's negative tracking leaves the box short of the ink on the right; shift to centre the ink */
  transform: translateX(calc(-50% - 0.025em));
}
.monument__word { display: block; transform-origin: 50% 100%; }

/* ---------- work: Alusia, explained once ---------- */
.work {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start;
  padding: var(--section) var(--margin);
}
.work__title { grid-column: 1 / span 5; font-size: var(--step-head); font-weight: 700; letter-spacing: -0.035em; line-height: 1; text-wrap: balance; }
.work__text { grid-column: 7 / -1; }
.work__lead { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; max-width: 38ch; text-wrap: balance; }
.work__text .cell { margin-top: 2.25rem; }

/* ---------- about ---------- */
/* Heading top-left, tools bottom-left, text on the right spanning both: the left column is framed at
   both ends instead of holding one word over an empty field. */
.about {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr;
  column-gap: var(--gutter); row-gap: 3rem;
  padding: var(--section) var(--margin); background: var(--field);
}
.about__title { grid-column: 1 / span 5; grid-row: 1; font-size: var(--step-head); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.about__text { grid-column: 7 / -1; grid-row: 1 / span 2; }
.about__para { font-size: var(--step-lead); font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; max-width: 30ch; text-wrap: balance; }
.about__more { margin-top: 1.75rem; max-width: 46ch; text-wrap: pretty; }
.tools { grid-column: 1 / span 5; grid-row: 2; align-self: end; }
.tools__label { color: var(--muted); font-size: var(--step-small); }
.tools__list { margin-top: 0.875rem; display: grid; grid-template-columns: repeat(2, max-content); gap: 0.5rem 3.5rem; }

/* ---------- contact: display rows ---------- */
.contact { display: grid; }
.row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem;
  padding: 4rem var(--margin) 1.75rem;
  font-size: var(--step-row); font-weight: 400; line-height: 1; letter-spacing: -0.035em;
}
.row:nth-child(odd) { background: var(--band); }
.row:nth-child(even) { background: var(--bg); }
.row__link { text-decoration: none; transition: color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .row__link:hover { color: var(--accent-light); } }
.copy {
  min-height: 2.75rem; padding: 0 1.1rem;
  font-size: var(--step-small); font-weight: 500; letter-spacing: 0;
  background: var(--field); color: var(--ink);
  transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.copy:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .copy:hover { background: #10224f; } }
html:not(.js) .copy { display: none; }
.round {
  display: inline-flex; align-items: center; justify-content: center;
  width: 0.9em; height: 0.9em; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.round svg { width: 42%; height: 42%; }
.round:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .round:hover { background: var(--accent-hover); transform: translateX(4px); } }

/* ---------- footer ---------- */
.footer {
  display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 4rem;
  padding: 2.5rem var(--margin) 1.5rem;
  background: var(--footer); color: var(--ink);
}
.footer__cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2rem; font-size: var(--step-small); }
.footer__cols ul { grid-column: span 4; display: flex; flex-direction: column; gap: 0.4rem; color: var(--footer-muted); }
.footer__cols li:first-child { color: var(--ink); font-weight: 500; margin-bottom: 0.2rem; }
.footer__legal { font-size: var(--step-small); color: var(--footer-muted); }


/* ---------- motion: arrival, one quiet rise per block, the handle settles as it leaves ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(18px); animation: rise 800ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 200ms); }
  .js .monument { animation: monument-in 1300ms var(--ease-expo) 60ms both; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  @supports (animation-timeline: view()) {
    .monument__word { animation: monument-weight linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes monument-in { from { opacity: 0; translate: 0 14%; } to { opacity: 1; translate: 0 0; } }
@keyframes monument-weight { to { scale: 0.94; } }

/* ---------- tablet ---------- */
@media (max-width: 900px) {
  .work__title, .about__title { grid-column: 1 / -1; }
  .work__text, .about__text { grid-column: 1 / -1; margin-top: 2rem; }
  .work__lead, .about__para { max-width: 40ch; }
  .about { grid-template-rows: none; row-gap: 0; }
  .about__text, .tools { grid-row: auto; }
  .tools { grid-column: 1 / -1; margin-top: 3rem; }
  .tools__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer__cols ul { grid-column: span 4; }
}

/* ---------- phone ---------- */
@media (max-width: 700px) {
  .menu-toggle { display: block; }
  .hero__nav { display: none; position: absolute; top: 2.25rem; right: calc(var(--margin) * -1); flex-direction: column; align-items: flex-end; gap: 1rem; padding: 1.25rem var(--margin); background: var(--field); }
  .hero__nav.is-open { display: flex; }
  html:not(.js) .hero__nav { display: flex; position: static; flex-direction: row; gap: 1rem; padding: 0; background: none; }
  html:not(.js) .menu-toggle { display: none; }

  .tools__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .row { padding: 2.5rem var(--margin) 1.25rem; }
  .row--hello { background: var(--accent) !important; color: var(--accent-ink); justify-content: space-between; padding-block: 1.25rem; }
  .row--hello .round { width: 3.5rem; height: 3.5rem; background: var(--ink); color: var(--accent); }

  .footer__cols { grid-template-columns: 1fr 1fr; }
  .footer__cols ul { grid-column: auto; }
}
