/* ------------------------------------------------------------
   kujda.com — built from Figma frame "Kujda.com Website" (1440 wide)
   ------------------------------------------------------------ */

:root {
  --bg: #ededed;
  --card: #ffffff;
  --ink: #333333;
  --ink-dark: #1b1b1b;
  --button-bg: #3a3a3a;      /* dark at all times; hover is the red outline flash only */
  --button-text: #d6d6d6;    /* Figma had #ededed */
  --ink-on-white: #3d3d3d;   /* headings inside white cards — same contrast on white as --ink has on the page gray */
  --ink-body-on-white: #505050; /* body copy inside white cards — ~10% lighter still */
  --rule-nav: #c4c4c4;       /* hairline under the nav, and the caption divider */
  --field-border: #c4c4c4;
  --placeholder: #6f6f6f;
  --valid: #2e8b57;          /* green check */
  --error: #e05252;          /* invalid-email border + message */

  --serif: "Benne", Georgia, "Times New Roman", serif;
  --sans: "Open Sans", "Helvetica Neue", Arial, sans-serif;

  --content-width: 1118px;   /* card width in the design */
  --gutter: 24px;            /* side padding below the 1440 breakpoint */
  --card-pad: 81px;          /* inner padding of the card */
  --card-gap: 60px;          /* space between stacked cards */
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Reserve the scrollbar's width on every page so short pages (About, Shows, Contact) don't sit a few px
     to the right of tall ones (Home, Writings). overflow-y: scroll is the fallback for browsers without scrollbar-gutter. */
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

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

h1, h2, p, ul { margin: 0; }

/* ---------- shared column ---------- */

.site-header,
main {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 1166px) {
  .site-header,
  main { padding-inline: 0; }
}

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

.site-header { padding-top: 50px; }

.site-nav {
  display: flex;
  gap: 40px;
  font-size: 13px;
  line-height: 1.8;
  padding-bottom: 14px;            /* nav text bottom (73) → rule (87) */
  border-bottom: 1px solid var(--rule-nav);
}

.site-nav .nav-contact { margin-left: auto; }

/* hover underline: a drawn 1px line (not text-decoration) so it can fade.
   Appears near-instantly, fades out over 500ms. Sized to the word, +1px each side. */
.site-nav a { position: relative; }

.site-nav a::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: 2px;                         /* same height as the approved underline (5px under baseline) */
  height: 1px;
  background: currentColor;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.1, 0.85, 0.25, 1);  /* steep early drop, faint tail */
  pointer-events: none;
}

/* hover-in: line appears instantly 30px too long, then settles to word length over 300ms.
   Stroke is 1px throughout (we animate the ends, not scale). Mouse-away fade unchanged. */
@keyframes nav-underline-settle {
  from { left: -16px; right: -16px; }
  to   { left: -1px;  right: -1px;  }
}

@media (hover: hover) {
  .site-nav a:hover::after {
    opacity: 1;
    transition: none;
    animation: nav-underline-settle 300ms ease-out;
  }
}

.site-nav a:focus-visible::after { opacity: 1; transition-duration: 70ms; }

/* current page: semibold, never underlined */
.site-nav a[aria-current="page"] { font-weight: 600; }
.site-nav a[aria-current="page"]::after { display: none; }

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-top: 147px;          /* nav rule (88) → title top (235) */
}

.masthead h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.04em;    /* -1.12px */
  color: var(--ink);
}

.location { font-size: 13px; line-height: 1.8; }

.button {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 146px;
  height: 53px;
  padding: 2px 0 0;           /* optical centering: Benne sits high in its box */
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-weight: 400;
  background: var(--button-bg);
  color: var(--button-text);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.04em;    /* -0.8px */
}


/* hover flash: 1px outline (button color) pops on 6px outside the button, then grows another 8px outward
   while fading out over 700ms. Stroke stays 1px (we move the edges, not scale). */
.button::before {
  content: "";
  position: absolute;
  inset: -7px;                          /* 6px gap, then the 1px line */
  border: 1px solid var(--button-bg);
  opacity: 0;
  pointer-events: none;
}

@keyframes button-outline-flash {
  from { opacity: 1; inset: -7px; }
  to   { opacity: 0; inset: -15px; }
}

@media (hover: hover) {
  .button:hover::before { animation: button-outline-flash 700ms linear forwards; }
}

.button:focus-visible { outline: 1px solid var(--button-bg); outline-offset: 6px; }

/* invisible hit target: the button responds to the mouse 15px beyond its solid fill on every side */
.button::after {
  content: "";
  position: absolute;
  inset: -15px;
}

/* ---------- artwork card ---------- */

main { padding-top: 60px; padding-bottom: 60px; }

.work {
  background: var(--card);
  padding: var(--card-pad);
  color: var(--ink-on-white);
}

.work + .work { margin-top: var(--card-gap); }

.work-image { margin: 0; }


.work-image img { width: 100%; }

.work-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px 329px;
  margin-top: 83px;
}

/* gaps either side of the divider: 10px left, 82px right (per Figma) */
.work-caption > * { grid-row: 1; }
.work-about { grid-column: 1; padding-right: 10px; }
.work-caption::before {
  content: "";
  grid-row: 1;
  grid-column: 2;
  width: 1px;
  height: 164px;
  background: var(--rule-nav);
}
.work-specs { grid-column: 3; padding-left: 82px; }

.work h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;    /* -0.64px */
  color: inherit;
  margin-bottom: 22px;        /* h2 bottom (1829) → body top (1851) */
}

/* body copy under the artwork: lighter than the heading, leading tightened 2pt (23.4 → 21.4px) */
.work-about p,
.work-specs ul {
  color: var(--ink-body-on-white);
  line-height: 1.65;
}

.work-about p { max-width: 515px; }

.work-about p + p { margin-top: 1em; }

.work-specs ul {
  list-style: none;
  padding: 0;
}

/* ---------- image carousel inside an artwork card ---------- */

.carousel { position: relative; }

/* all slides share one box; the active one fades in over the previous. Slides must share an aspect ratio. */
.carousel-track { position: relative; }

.carousel-slide {
  margin: 0;
  opacity: 0;
  transition: opacity 900ms ease;
}

.carousel-slide:not(:first-child) {
  position: absolute;
  inset: 0;
}

.carousel-slide.is-active { opacity: 1; }

.carousel-slide img { width: 100%; }

/* arrows: quiet until the visitor hovers the image; always visible without a hover pointer */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-on-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 300ms ease, background 200ms ease;
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-arrow:hover { background: var(--card); }

.carousel-arrow:focus-visible { opacity: 1; outline: 1px solid var(--ink); outline-offset: 2px; }

@media (hover: hover) {
  .carousel:hover .carousel-arrow { opacity: 1; }
}

@media (hover: none) {
  .carousel-arrow { opacity: 1; }
}

/* dots: small gray circles under the image, in the caption's top margin */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.carousel-dots [role="tab"] {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.carousel-dots [role="tab"]::after {
  content: "";
  position: absolute;
  inset: 8px;                            /* 8px dot inside the 24px hit target */
  border-radius: 50%;
  border: 1px solid var(--ink-on-white);
  background: transparent;
  transition: background 200ms ease;
}

.carousel-dots [role="tab"][aria-selected="true"]::after { background: var(--ink-on-white); }

.carousel-dots [role="tab"]:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; }

/* the dots take the top of the caption gap, so the caption moves up by the dots' height */
.carousel + .work-caption { margin-top: 37px; }   /* 83 − 22 − 24 */

@media (prefers-reduced-motion: reduce) {
  .carousel-slide { transition: none; }
}

/* ---------- image grid inside an artwork card: 3 × 2 square tiles ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;                             /* same step as heading → body */
}

.grid-tile { margin: 0; }
.grid-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

@media (max-width: 760px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ---------- split layout inside an artwork card: one portrait left, two landscapes stacked right ----------
   Column ratio chosen so a 0.86 portrait on the left equals two 4:3 images + the gutter on the right.
   Images are object-fit: cover, so other proportions still fill the boxes (with cropping). */

.work-split {
  display: grid;
  grid-template-columns: 534fr 400fr;
  grid-template-rows: auto auto;
  gap: 22px;
}

.work-split figure { margin: 0; min-height: 0; }

.split-tall { grid-row: 1 / span 2; }
.split-tall img { width: 100%; height: 100%; object-fit: cover; }

.split-wide img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

@media (max-width: 760px) {
  .work-split { grid-template-columns: 1fr; grid-template-rows: auto; gap: 12px; }
  .split-tall { grid-row: auto; }
  .split-tall img { height: auto; }
}

/* ---------- home: short intro card, headshot + blurb ---------- */

.intro {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  column-gap: 60px;
  align-items: center;
}

.intro-portrait { margin: 0; }
.intro-portrait img { width: 100%; }

.intro-text h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.intro-text p {
  color: var(--ink-body-on-white);
  line-height: 1.65;
  max-width: 560px;
}

.intro-greeting {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-on-white) !important;
  margin-bottom: 18px;
}

.intro-text p + p:not(.intro-more) { margin-top: 1em; }

.intro-more { margin-top: 18px; }
.intro-more a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- about page: portrait + words side by side ---------- */

.bio {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  column-gap: 60px;
  align-items: start;
}

.bio-portrait { margin: 0; }
.bio-portrait img { width: 100%; }

.bio-text h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.bio-text p {
  color: var(--ink-body-on-white);
  line-height: 1.65;
  max-width: 515px;
}

.bio-text p + p { margin-top: 1em; }

.bio-text p a { text-decoration: underline; text-underline-offset: 3px; }

.bio-signature {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink-on-white) !important;
  margin-top: 28px !important;
}

/* ---------- writings ---------- */

.writing-item + .writing-item { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--rule-nav); }

.writing-item h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.writing-item h2 a:hover { text-decoration: underline; text-underline-offset: 5px; }

.writing-meta { color: var(--ink-body-on-white); margin: 6px 0 14px; }

.writing-teaser {
  color: var(--ink-body-on-white);
  line-height: 1.65;
  max-width: 640px;
}

.writing-toggle { margin-top: 28px; }

.writing-body { margin-top: 48px; }

/* an essay: one comfortable reading column */
.essay p {
  max-width: 640px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-body-on-white);
}

.essay p + p { margin-top: 1.1em; }

.essay em { font-style: italic; }

.essay-figure { margin: 40px 0; }
.essay-figure img { width: 100%; }
.essay-figure figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-body-on-white);
}

/* "Superposition of Minds" figure: System 1 (two landscapes stacked, left) beside System 2 (one portrait, right),
   a label under each. Both columns stretch to the same height; the left column (two 4:3 images) sets it and the
   portrait fills the rest of its column with object-fit: cover. Same 400:534 ratio as the Form Works card, mirrored. */
.systems-grid {
  display: grid;
  grid-template-columns: 400fr 534fr;
  gap: 22px;
  align-items: stretch;
}

.sys-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.sys-col img { width: 100%; height: auto; display: block; }
.sys-col-1 img { aspect-ratio: 4 / 3; object-fit: cover; }
.sys-tall { flex: 1 1 0; min-height: 0; height: auto; object-fit: cover; }

.sys-label {
  margin: -6px 0 0 !important;           /* tuck up under the image so the 22px gap reads as 16 */
  font-size: 13px !important;
  line-height: 1.65;
  color: var(--ink-body-on-white);
  max-width: none !important;            /* override .essay p */
}
.sys-label strong { display: block; font-weight: 600; color: var(--ink-on-white); }

.essay-systems figcaption { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--rule-nav); }

@media (max-width: 760px) {
  .systems-grid { grid-template-columns: 1fr; gap: 24px; }
  .sys-col { gap: 12px; }
  .sys-tall { flex: none; }
}

.essay-source {
  margin-top: 40px !important;
  padding-top: 24px;
  border-top: 1px solid var(--rule-nav);
  font-size: 13px !important;
}

.essay-source a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- contact form (contact.html) ---------- */

.contact-card {
  background: var(--card);
  padding: var(--card-pad);             /* same 81px frame as the artwork cards */
  color: var(--ink-on-white);
}

.contact-form {
  width: 529px;
  max-width: 100%;
  position: relative;
}

.contact-form h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: inherit;
  max-width: 428px;
  margin-bottom: 41px;                  /* heading bottom 496 → first field 537 */
}

.field { position: relative; }
.field + .field { margin-top: 13px; }   /* 581 → 594 */

.field input,
.field textarea {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 25px;                      /* text at x=297 inside box at x=272 */
  border: 1px solid var(--field-border);
  border-radius: 0;
  background: var(--card);
  color: var(--ink-on-white);
  font: inherit;
  font-size: 13px;
  line-height: 1.8;
  appearance: none;
  -webkit-appearance: none;
}

/* small type while empty (placeholder showing), 20px once the visitor starts typing */
.field input,
.field textarea { font-size: 20px; line-height: 1.8; }

.field input:placeholder-shown,
.field textarea:placeholder-shown { font-size: 13px; line-height: 1.8; }

.field textarea {
  height: 191px;
  padding-top: 11px;                    /* text at y=662 inside box at y=651 */
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--placeholder); opacity: 1; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 0;
}

/* valid-email check: 25×25 at x=835 → 34px right of the field, vertically centred */
.field-check {
  position: absolute;
  left: calc(100% + 34px);
  top: 50%;
  transform: translateY(-50%);
  color: var(--valid);
  display: none;
}
.field.is-valid .field-check { display: block; }

/* incomplete-email message: sits where the check does, 321px wide */
.field-error {
  position: absolute;
  left: calc(100% + 34px);
  top: 50%;
  transform: translateY(-50%);
  width: 321px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--error);
  display: none;
}
.field.is-invalid .field-error { display: block; }
.field.is-invalid input { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field.is-invalid input:focus-visible { outline-color: var(--error); }

.form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 23px;                     /* textarea bottom 842 → button 865 */
}

.form-status { font-size: 13px; }
.form-status:not(:empty) { margin-top: 16px; }

/* pages with no subtext under the title: keep the first card at the same 352 top */
.no-subtitle main { padding-top: 83px; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

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

.site-footer {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 14px var(--gutter) 60px;   /* rule → text matches nav text → rule */
  border-top: 1px solid var(--rule-nav);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
}

@media (min-width: 1166px) {
  .site-footer { padding-inline: 0; }
}

@media (max-width: 480px) {
  .site-footer { flex-direction: column; gap: 0; }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  :root { --card-pad: 48px; }
  /* no room beside the field: drop check inside it, error below it */
  .field-check { left: auto; right: 12px; }
  .field-error {
    position: static; transform: none; width: auto;
    margin-top: 6px;
  }
  .work-caption {
    grid-template-columns: minmax(0, 1fr) 1px 260px;
  }
  .bio { grid-template-columns: 320px minmax(0, 1fr); column-gap: 40px; }
  .intro { grid-template-columns: 220px minmax(0, 1fr); column-gap: 40px; }
  .work-specs { padding-left: 48px; }
}

@media (max-width: 760px) {
  :root { --card-pad: 24px; --card-gap: 32px; --gutter: 16px; }

  .site-header { padding-top: 32px; }
  .masthead { margin-top: 72px; }

  .work-caption {
    grid-template-columns: 1fr;
    margin-top: 40px;
    row-gap: 32px;
  }
  .bio { grid-template-columns: 1fr; row-gap: 32px; }
  .intro { grid-template-columns: 1fr; row-gap: 24px; }
  .intro-portrait { max-width: 240px; }
  .work-caption::before { display: none; }
  .work-about { grid-row: 1; grid-column: 1; padding-right: 0; }
  .work-specs { grid-row: 2; grid-column: 1; padding-left: 0; }

  .work h2 { font-size: 26px; }

  .contact-form h2 { font-size: 24px; margin-bottom: 28px; }
  .form-actions .button { width: 100%; }
}

@media (max-width: 480px) {
  .masthead { flex-direction: column; }
  .button { width: 100%; }
}
