/* lucanos.com
 *
 * Only what cannot be an inline style lives here: resets, keyframes, hover and
 * open states, the responsive grid spans, and print. Everything else is set on
 * the element in views/html.php, next to the markup it belongs to.
 */

:root {
  --accent: #33FF66;
  --ink: #F4F1EA;
  --ground: #0B0B0C;
  --ground-2: #0F0F10;
  --ground-3: #0C1410;
  --hair: rgba(244, 241, 234, .12);
  --ease: cubic-bezier(.22, .7, .28, 1);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Newsreader, Georgia, serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
button { font: inherit; }
::selection { background: var(--accent); color: var(--ground); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--ground);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.skip:focus { left: 12px; top: 12px; color: var(--ground); }

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes csFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes csRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.marquee { animation: marquee 46s linear infinite; }

/* Nav ------------------------------------------------------------------ */
.navlink { color: #8A8A85; }
.navlink::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.navlink:hover { color: var(--ink); }
.navlink:hover::after { transform: scaleX(1); }
.navlink[aria-current="true"] { color: var(--accent); }
.navlink[aria-current="true"]::after { transform: scaleX(1); }

.iconbtn:hover, .ghost:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
.solid:hover { background: var(--ink) !important; }
.cvitem:hover { background: var(--ground-3); }
.cvmenu { animation: csRise .24s var(--ease) both; }

/* Shared transitions -------------------------------------------------- */
a, button, .cs, .cs-cta > span, .cs-cta::before, .cs-plus, .awd {
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-duration: .3s;
  transition-timing-function: var(--ease);
}
.cs { transition-duration: .32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, button, .cs, .cs-cta > span, .cs-cta::before, .cs-plus, .navlink::after, .awd { transition-duration: .01ms; }
  .marquee, .cs-new, .cvmenu { animation: none; }
}

/* Filter chips: appearance follows aria-pressed, so JS only sets state ---- */
.chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(244, 241, 234, .22);
  background: transparent;
  color: #8A8A85;
  cursor: pointer;
  transition: all .3s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ground);
}

/* Career accordion ----------------------------------------------------- */
.job summary { list-style: none; }
.job summary::-webkit-details-marker { display: none; }
.job summary:hover { background: rgba(244, 241, 234, .04); }
.job .sign::before { content: "+"; }
.job[open] .sign::before { content: "\2212"; }

/* Case cards ---------------------------------------------------------- */
.cs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  /* A backstop: nothing inside a card may paint outside it. */
  overflow: hidden;
}
.cs-body { display: flex; flex-direction: column; flex: 1; padding: 30px 28px 34px; }
.cs-full .cs-body { padding: 44px 40px 38px; }
.cs-title { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.02; }
.cs-full .cs-title { font-size: clamp(30px, 3.2vw, 48px); line-height: 1; }
.cs-full .cs-lede { font-size: 20px; max-width: 640px; }
.cs-full .stats { gap: 24px; }
.cs-full .stats > * > div:first-child { font-size: 38px; }
.csimg {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  /* Grid items floor at their content size unless told otherwise, which is how
   * an image ends up taller than the card holding it. */
  min-width: 0;
  min-height: 0;
  border-bottom: 1px solid var(--hair);
}
/*
 * On a full-width card the image sits beside the copy and takes its height from
 * it, so it cannot carry a ratio. It stretches into the row instead, with a
 * floor for the case where the copy is short.
 */
.cs-full .csimg {
  aspect-ratio: auto;
  align-self: stretch;
  min-height: 300px;
  border-bottom: 0;
  border-right: 1px solid var(--hair);
}

.cs:hover { background: var(--ground-2); }
.cs-cta { position: relative; overflow: hidden; background: rgba(244, 241, 234, .05); }
.cs-cta > span { position: relative; z-index: 1; color: var(--ink); }
.cs-cta > .cs-plus {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  transition-duration: .3s, .3s, .3s, .3s, .3s, .4s;
}
.cs-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition-duration: .34s;
}
.cs:hover .cs-cta::before { transform: translateY(0); }
.cs:hover .cs-cta > span { color: var(--ground); }
.cs:hover .cs-cta > .cs-plus { color: var(--ground); transform: rotate(90deg); }

/* A third-width card shows two stats; the rest wait in the modal. */
@media (min-width: 1181px) {
  .cs-third .stats > *:nth-child(n+3) { display: none; }
}

/* Below the modal breakpoint the detail opens inside the card itself. */
.cs-detail { display: none; }
.cs[data-open="true"] .cs-detail { display: flex; }
@media (min-width: 861px) {
  .cs[data-open="true"] .cs-detail { display: none; }
}

.csplay { opacity: 0; pointer-events: none; }
.cs:hover .csplay, .cs:focus-within .csplay { opacity: 1; pointer-events: auto; }
@media (hover: none) { .csplay { opacity: 1; pointer-events: auto; } }

/*
 * Absolutely positioned, so the media never contributes intrinsic height to the
 * card. This is the fix for images overflowing their box: a 2400×1350 file laid
 * out in flow reports 1350px tall the moment its parent's height is auto.
 */
.csimg img, .csimg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.csimg-full img { object-fit: contain; }
@media (max-width: 760px) {
  .cs-full .csimg, .csimg-full { min-height: 0; aspect-ratio: 16 / 9; }
}

.cs-new { animation: csRise .5s var(--ease) both; }
.cs-new:nth-of-type(6n+1) { animation-delay: 0s; }
.cs-new:nth-of-type(6n+2) { animation-delay: .05s; }
.cs-new:nth-of-type(6n+3) { animation-delay: .1s; }
.cs-new:nth-of-type(6n+4) { animation-delay: .15s; }
.cs-new:nth-of-type(6n+5) { animation-delay: .2s; }
.cs-new:nth-of-type(6n+6) { animation-delay: .25s; }

.cs-full { grid-column: span 6; }
.cs-half { grid-column: span 3; }
.cs-third { grid-column: span 2; }
@media (max-width: 1180px) {
  .cs-third { grid-column: span 3; }
  .cs-third.cs-odd-last { grid-column: span 6; }
}
@media (max-width: 860px) {
  /* Full-width cards carry an inline two-column value set by the script; below
   * this width every card is one column again. */
  .cs {
    grid-column: span 6 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .cs-full .csimg { border-right: 0; border-bottom: 1px solid var(--hair); }
}

.more:hover { border-color: var(--accent); color: var(--accent); }
.awd:hover { background: var(--ground-3); }
.awd-flat { cursor: default; }
.awd-flat:hover { background: var(--ground-2); }

/* Modal --------------------------------------------------------------- */
.cs-modal { display: flex; animation: csFade .2s ease; }
@media (max-width: 860px) { .cs-modal { display: none !important; } }
.cs-modal-panel { animation: csRise .34s var(--ease); }
.mbody { grid-template-columns: minmax(0, 1fr) 268px; }
.mrail { padding: 44px 36px 48px; border-left: 1px solid rgba(244, 241, 234, .14); }
@media (max-width: 1000px) {
  .mbody { grid-template-columns: minmax(0, 1fr); }
  .mrail { border-left: 0; border-top: 1px solid rgba(244, 241, 234, .14); padding: 32px 44px 44px; }
}

/* Responsive layout shifts -------------------------------------------- */
.svc-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
@media (max-width: 1080px) { .svc-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

@media (max-width: 900px) {
  .hero-grid, .split, .split-wide { grid-template-columns: minmax(0, 1fr) !important; gap: 40px !important; }
  .sticky { position: static !important; }
  .navlinks { gap: 14px !important; }
  .navlinks .navlink { display: none; }
  .job-row { grid-template-columns: minmax(0, 1fr) 32px !important; row-gap: 8px !important; }
  .job-row .job-org { grid-column: 1 / -1; }
  .job-body { grid-template-columns: minmax(0, 1fr) !important; }
  .hv-row { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
}
@media (max-width: 560px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Print: the page is its own CV ---------------------------------------- */
@media print {
  @page { margin: 12mm; }
  html, body {
    background: #0B0B0C !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  [data-noprint] { display: none !important; }
  .cs { grid-column: span 6 !important; }
  section, article { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
}
