/* =============================================
   Pieter de Jong — Cabinetmaker, Cape Town
   Bauhaus-inspired: primary colours, geometric
   shapes, bold typography, modular grid.
   ============================================= */

/* ---- reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --red:    #d93a2b;
  --yellow: #e8b82a;
  --blue:   #1f5090;
  --black:  #111111;
  --white:  #f7f5f0;
  --grey:   #c4bfb4;
  --dark-grey: #2a2824;
  --ink:    var(--black);
  --bg:     var(--white);
  --muted:  #6b6558;
  --rule:   #d4cec2;
  --card-bg: #ffffff;
  --accent: var(--blue);
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #181614;
    --white:  #1e1c18;
    --card-bg: #24221e;
    --ink:    #e4ddd0;
    --muted:  #8a8273;
    --rule:   #3a352c;
    --red:    #e05040;
    --yellow: #d4a828;
    --blue:   #3a7acc;
  }
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-underline-offset: 0.15em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- site header ---- */
.site-header {
  position: relative;
  padding: 1.5rem 1.5rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.header-geo {
  position: absolute;
  top: 0;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  background: var(--red);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  opacity: 0.15;
}

.header-inner {
  border-bottom: 4px solid var(--black);
  padding-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1.1;
}

.site-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.site-nav a {
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--ink);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  border-bottom-color: var(--red);
}

/* ---- Bauhaus colour band ---- */
.band {
  display: flex;
  height: 8px;
  max-width: 1200px;
  margin: 0 auto;
}
.band span { flex: 1; }
.band-red    { background: var(--red); }
.band-yellow { background: var(--yellow); }
.band-blue   { background: var(--blue); }

/* ---- main container ---- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ---- intro ---- */
.intro {
  padding: 2.5rem 0 1.5rem;
  max-width: 720px;
}

.intro-text {
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 0;
}

/* ---- section headings ---- */
.section-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.heading-deco {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--yellow);
  flex-shrink: 0;
}

/* ---- gallery grid ---- */
.gallery {
  padding: 2rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ---- piece card ---- */
.piece-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border: 2px solid var(--black);
  transition: transform 0.15s, box-shadow 0.15s;
}

.piece-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.12);
}

.piece-card-visual {
  aspect-ratio: 4 / 3;
  background: var(--grey);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.geo-placeholder {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geo-inner {
  display: block;
  width: 60px;
  height: 60px;
  background: var(--blue);
  opacity: 0.4;
  transform: rotate(15deg);
}

.piece-card:nth-child(2n) .geo-inner {
  background: var(--red);
  border-radius: 50%;
  transform: none;
}

.piece-card:nth-child(3n) .geo-inner {
  background: var(--yellow);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  transform: none;
  border-radius: 0;
}

.piece-card-body {
  padding: 1rem 1rem 1.25rem;
  border-top: 2px solid var(--black);
}

.piece-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.25rem;
}

.piece-card-material {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.piece-card-year {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

/* ---- contact section ---- */
.contact {
  padding: 3rem 0 1rem;
  position: relative;
}

.contact-shape {
  position: absolute;
  right: 0;
  top: 2rem;
  width: 100px;
  height: 100px;
  background: var(--yellow);
  opacity: 0.08;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-block h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--black);
}

.contact-block p {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.address {
  margin-top: 0.6rem;
  font-style: normal;
  line-height: 1.5;
  color: var(--muted);
}

/* ---- hours table ---- */
.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hours td {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
}

.hours td:last-child {
  text-align: right;
  font-weight: 600;
}

/* ---- contact form ---- */
.form-block label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-block label span {
  display: block;
  margin-bottom: 0.2rem;
}

.form-block input,
.form-block textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 2px solid var(--black);
  background: var(--card-bg);
  color: var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
}

.form-block input:focus,
.form-block textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid var(--black);
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-appearance: none;
}

.btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.form-status {
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

/* ---- piece detail page ---- */
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  margin-bottom: 1.5rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid var(--black);
  color: var(--ink);
}

.back-link:hover {
  border-bottom-color: var(--red);
  color: var(--red);
}

.piece-detail {
  padding: 2rem 0;
}

.piece-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

@media (max-width: 700px) {
  .piece-detail-layout {
    grid-template-columns: 1fr;
  }
}

.piece-detail-visual {
  aspect-ratio: 4 / 3;
  background: var(--grey);
  display: flex;
  align-items: center;
  justify-content: center;
}

.geo-detail .geo-inner {
  width: 100px;
  height: 100px;
  opacity: 0.5;
}

.piece-detail-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 1.25rem;
  line-height: 1.15;
}

.piece-specs {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.piece-specs td {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}

.piece-specs td:first-child {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  width: 120px;
  color: var(--muted);
}

.piece-detail-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.piece-detail-cta {
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---- footer ---- */
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 2px solid var(--black);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.site-footer .muted {
  color: var(--muted);
  margin: 0;
}

footer .attribution {
  font-size: 0.75rem;
  opacity: 0.7;
}

footer .attribution a {
  color: var(--muted);
  text-decoration: none;
}

footer .attribution a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* ---- utilities ---- */
.muted { color: var(--muted); }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .piece-card:hover {
    transform: none;
    box-shadow: none;
  }
}
