/* sandragodwin.com
   Layout modelled on a calm, editorial single-page structure:
   cream ground, letter-spaced lowercase Cardo headings, Courier Prime prose,
   rounded image tiles. Content and imagery: Sandra Godwin / Casa de Meraki. */

:root {
  --ground: #f8f5f0;
  --ink: #51443a;
  --ink-strong: #3a2e26;
  --cream: #f8f5f0;
  --sand: #ebd7b7;
  --sand-deep: #d9bf96;

  --font-heading: "Cardo", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-type: "Courier Prime", "Courier New", monospace;

  --fs-small: 0.9rem;
  --fs-medium: 1.05rem;
  --fs-large: clamp(1.39rem, 1.39rem + ((1vw - 0.2rem) * 0.575), 1.85rem);
  --fs-xx-large: clamp(2.5rem, 2.5rem + ((1vw - 0.2rem) * 0.963), 3.27rem);

  --sp-10: 1rem;
  --sp-20: min(1.5rem, 2vw);
  --sp-40: min(4rem, 5vw);
  --sp-50: min(6.5rem, 8vw);
  --sp-60: min(10.5rem, 13vw);

  --radius: 20px;
  --track: 0.42em;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-medium);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink-strong);
  outline-offset: 4px;
  border-radius: 4px;
}

::selection { background: var(--sand); color: var(--ink-strong); }

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

/* Letter-spaced lowercase voice. The trailing track is offset so centred
   lines stay optically centred. */
.sp {
  font-family: var(--font-heading);
  text-transform: lowercase;
  letter-spacing: var(--track);
  word-spacing: 0.35em;
  font-weight: 400;
}
.center { text-align: center; }
.center.sp { padding-left: var(--track); }

.fs-small { font-size: var(--fs-small); }
.fs-medium { font-size: var(--fs-medium); }
.fs-large { font-size: var(--fs-large); }

.type {
  font-family: var(--font-type);
  font-size: var(--fs-small);
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- header ---------- */
.site-header {
  background: var(--ground);
  color: var(--ink-strong);
  padding: 20px var(--sp-40);
}
.site-header__inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-20);
}
.nav { display: flex; gap: var(--sp-20); flex-wrap: wrap; }
.nav a { font-size: var(--fs-small); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px; }

.logo { display: inline-flex; align-items: center; gap: 0.75rem; }
.logo img {
  width: 56px;
  height: auto;
}
.logo span { font-size: var(--fs-small); }
.logo:hover { text-decoration: none; }

.header-aside a { font-size: var(--fs-small); }

/* ---------- hero ---------- */
.hero {
  background-color: #4b2f43;
  background-image: url("images/hero-abstract.jpg");
  background-size: cover;
  background-position: 33% 60%;
  padding: var(--sp-50);
}
.hero__title {
  margin: var(--sp-60) 0;
  padding: var(--sp-50) 0;
  color: var(--cream);
  font-size: var(--fs-xx-large);
  line-height: 1.2;
}
.hero__sub {
  margin: 0;
  color: var(--cream);
  font-size: var(--fs-small);
}

/* ---------- generic ---------- */
main { padding: 0 var(--sp-40); }
.wide { max-width: 1600px; margin: 0 auto; }
.spacer-s { height: 35px; }
.spacer-m { height: 45px; }
.spacer-l { height: 50px; }
.spacer-xl { height: 100px; }

p { margin: 0 0 1.2rem; }

.intro {
  margin: 0;
  line-height: 1.5;
}

hr.rule {
  border: 0;
  height: 1px;
  background: var(--sand);
  margin: 0;
}

/* Three columns, bottom aligned, stacking on small screens */
.cols {
  display: flex;
  gap: 2em;
  align-items: flex-end;
}
.cols > * { flex: 1 1 0; min-width: 0; }
.cols--top { align-items: flex-start; }
.col-pad { padding: 0 var(--sp-10); }

/* square cover tiles */
.tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: end;
  padding-bottom: 14%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1px 2px rgba(58, 46, 38, 0.06), 0 8px 24px -12px rgba(58, 46, 38, 0.25);
}
.tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  transition: scale 0.9s cubic-bezier(0.2, 0, 0, 1);
}
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(30, 22, 18, 0.42), rgba(30, 22, 18, 0.06) 55%);
  z-index: -1;
  transition: opacity 0.4s ease;
}
.tile:hover img { scale: 1.04; }
.tile:hover::after { opacity: 0.85; }
.tile:hover { text-decoration: none; }
.tile__label {
  color: var(--cream);
  font-size: var(--fs-large);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}
.tile-caption { margin: 1.1rem 0 0; line-height: 1.7; }

/* tall portrait images */
.tall {
  margin: 0 var(--sp-10);
  aspect-ratio: 2 / 3;
  border-radius: var(--sp-20);
  overflow: hidden;
  outline: 1px solid rgba(58, 46, 38, 0.08);
  outline-offset: -1px;
}
.tall:first-child { border-radius: var(--radius); }
.tall img { width: 100%; height: 100%; object-fit: cover; }

/* button */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem 0.85rem calc(1.6rem + var(--track));
  border-radius: var(--radius);
  background: var(--sand);
  color: var(--ink-strong);
  font-family: var(--font-type);
  font-size: var(--fs-small);
  letter-spacing: var(--track);
  text-transform: lowercase;
  transition-property: background-color, scale;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
.btn:hover { background: var(--sand-deep); text-decoration: none; }
.btn:active { scale: 0.96; }
.btn-wrap { display: flex; justify-content: center; }

/* meraki definition */
.meraki {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}
.meraki__greek {
  font-family: var(--font-heading);
  font-size: var(--fs-xx-large);
  line-height: 1.1;
  margin: 0 0 0.4rem;
}
.meraki__say { margin: 0 0 1.4rem; }

/* page heading for inner pages */
.page-head {
  padding: var(--sp-50) 0 var(--sp-40);
}
.page-head h1 {
  margin: 0;
  font-size: var(--fs-xx-large);
  line-height: 1.2;
}

/* about page */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--sp-40);
  align-items: start;
}
.about-grid .tall { margin: 0; }
.about-text { max-width: 38rem; }
.about-text p { font-size: 0.95rem; }

/* art page */
.gallery {
  columns: 3 280px;
  column-gap: 2em;
}
.gallery figure {
  break-inside: avoid;
  margin: 0 0 2.2em;
}
.gallery img {
  width: 100%;
  border-radius: var(--radius);
  outline: 1px solid rgba(58, 46, 38, 0.08);
  outline-offset: -1px;
}
.gallery figcaption { margin-top: 0.8rem; }

/* ---------- footer ---------- */
.site-footer {
  padding: var(--sp-40) var(--sp-40) var(--sp-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.site-footer__mark img { width: 110px; }
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 2.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a { font-size: var(--fs-small); }
.copyright { font-family: var(--font-type); font-size: 0.75rem; opacity: 0.7; margin: 0; }

/* ---------- reveal (one quiet entrance for the hero only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__title { animation: rise 1.2s cubic-bezier(0.2, 0, 0, 1) both; }
  .hero__sub { animation: rise 1.2s 0.15s cubic-bezier(0.2, 0, 0, 1) both; }
  @keyframes rise {
    from { opacity: 0; translate: 0 10px; }
    to { opacity: 1; translate: 0 0; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile img, .tile::after, .btn { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 781px) {
  .cols { flex-direction: column; align-items: stretch; gap: 2.5rem; }
  .cols .spacer-xs-hide { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .tall { margin: 0; }
}

@media (max-width: 640px) {
  :root { --track: 0.3em; }
  .site-header__inner { flex-wrap: wrap; justify-content: center; row-gap: 0.9rem; }
  .logo { order: -1; width: 100%; justify-content: center; }
  .header-aside { display: none; }
  .nav { justify-content: center; }
  .hero { padding: 3rem 1.25rem; }
  .hero__title { margin: 3rem 0 1rem; padding: 0; }
  main { padding: 0 16px; }
}
