/* Place Itten — shared styles for index.html, explainer.html, example.html */

:root {
  --yellow: #f7d417;
  --red: #be1e2d;
  --blue: #0061a8;
  --ink: #141414;
  --paper: #f4f1ea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

a { color: var(--blue); }

code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  background: #fff;
  border: 1px solid #ddd;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* --- header & logo mark --- */
header {
  padding: 3rem 1.5rem 2rem;
  max-width: 62rem;
  margin: 0 auto;
}
.back { font-size: 0.9rem; text-decoration: none; }
.mark { display: flex; gap: 0.4rem; margin: 1.25rem 0 1.5rem; }
.mark span { width: 28px; height: 28px; display: inline-block; }
.mark .c { border-radius: 50%; }
.mark .t {
  width: 0; height: 0; background: none !important;
  border-left: 14px solid transparent; border-right: 14px solid transparent;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
/* the homepage title is a larger hero */
.home h1 { font-size: clamp(2.5rem, 8vw, 5rem); }

.lede { font-size: 1.2rem; max-width: 42rem; }
.byline { font-size: 0.9rem; color: #555; margin-top: 0.5rem; }

/* --- layout --- */
main { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem 4rem; }
section { margin-top: 3.5rem; }
h2 { font-size: 1.6rem; border-bottom: 3px solid var(--ink); padding-bottom: 0.3rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }
p { max-width: 46rem; }
.story p + p { margin-top: 1.1rem; }

/* --- figures --- */
figure { margin: 0; }
figure img {
  display: block;
  border: 1px solid #ddd;
  background: #fff;
  max-width: 100%;
  height: auto;
}
figcaption {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  color: #555;
  max-width: 46rem;
}

/* --- usage list (index) --- */
.usage li { margin: 0.4rem 0; }

/* --- contrast gallery (index, example) --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.gallery figure img { width: 100%; }

/* --- color wheel (explainer) --- */
.wheel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  align-items: center;
  margin-top: 1.5rem;
}
.wheel {
  flex: 0 0 auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: conic-gradient(
    #f7d417 0deg 30deg,
    #f59b00 30deg 60deg,
    #ed6a00 60deg 90deg,
    #e1470e 90deg 120deg,
    #be1e2d 120deg 150deg,
    #a2195b 150deg 180deg,
    #652d86 180deg 210deg,
    #2e3192 210deg 240deg,
    #0061a8 240deg 270deg,
    #00a19a 270deg 300deg,
    #00a651 300deg 330deg,
    #8cc63f 330deg 360deg
  );
  box-shadow: 0 1px 0 #ddd, inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  position: relative;
}
.wheel::after {
  content: "";
  position: absolute;
  inset: 33%;
  border-radius: 50%;
  background: var(--paper);
}
.legend {
  flex: 1 1 18rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.4rem 1rem;
  font-size: 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.legend li { display: flex; align-items: center; gap: 0.5rem; }
.legend .sw { width: 16px; height: 16px; flex: 0 0 auto; border: 1px solid rgba(0, 0, 0, 0.15); }
.legend .hex { color: #777; font-family: "SF Mono", ui-monospace, Menlo, monospace; margin-left: auto; }

/* --- contrast cards (explainer) --- */
.contrast {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #ddd;
}
.contrast:first-of-type { border-top: none; }
.contrast img { width: 100%; }
.contrast .meta code { display: inline-block; margin-top: 0.5rem; }
@media (max-width: 38rem) {
  .contrast { grid-template-columns: 1fr; }
}

/* --- pipeline list (explainer) --- */
ol.pipeline { max-width: 46rem; padding-left: 1.2rem; }
ol.pipeline li { margin: 0.6rem 0; }

/* --- banner image (example) --- */
.banner { margin: 2.5rem 0; }
.banner img { width: 100%; }

/* --- image floated beside a paragraph (example) --- */
.float-right { float: right; width: 300px; max-width: 45%; margin: 0.3rem 0 1.25rem 1.75rem; }
.float-left  { float: left;  width: 300px; max-width: 45%; margin: 0.3rem 1.75rem 1.25rem 0; }
.clear { clear: both; }

/* --- portrait + text plate (example) --- */
.plate {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 2rem;
}
.plate img { width: 100%; }
@media (max-width: 40rem) {
  .plate { grid-template-columns: 1fr; }
  .float-right, .float-left { float: none; width: 100%; max-width: 100%; margin: 1.25rem 0; }
}

/* --- one contrast, several sizes (example) --- */
.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  margin-top: 1.5rem;
}
.sizes figure { display: flex; flex-direction: column; }

/* --- swatch strip (example) --- */
.strip { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.strip img { width: 64px; height: 64px; }

/* --- footer --- */
footer {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
  color: #555;
}
footer h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.sources { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.sources li { margin: 0.3rem 0; }
