/* IWAI homepage. Colours come from the logo: gold brain, black wordmark. */

:root {
  --gold: #cdaa4c;
  --gold-light: #e2c675;
  --gold-dark: #7d6319;
  --ink: #0f0f10;
  --ink-2: #18181a;
  --text: #1c1c1e;
  --muted: #62605a;
  --line: #e9e6dd;
  --line-dark: rgba(255, 255, 255, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--gold-dark); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 640px) { .wrap { padding: 0 22px; } }

.eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 20px; min-height: 68px; }
.bar img { display: block; width: 64px; height: auto; }
.bar nav { display: flex; flex-wrap: wrap; gap: 2px 28px; }
.bar nav a { color: var(--text); text-decoration: none; font-size: .92rem; padding: 6px 0; background: linear-gradient(var(--gold), var(--gold)) left bottom / 0 2px no-repeat; transition: background-size .25s ease; }
.bar nav a:hover { background-size: 100% 2px; }
@media (max-width: 640px) { .bar nav { gap: 2px 16px; padding-bottom: 8px; } .bar nav a { font-size: .85rem; } }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 560px at 82% 42%, rgba(205, 170, 76, .17), transparent 70%),
    linear-gradient(160deg, #18181a 0%, var(--ink) 60%);
}
.hero .wrap { position: relative; z-index: 1; padding-top: 118px; padding-bottom: 72px; }
.hero .eyebrow { color: var(--gold); }
.hero h1 {
  max-width: 14em;
  margin: 26px 0 30px;
  font-size: clamp(2.6rem, 6.3vw, 5.4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.022em;
}
.hero h1 strong { display: block; font-weight: 900; color: var(--gold); }
.lede { font-size: clamp(1.1rem, 1.8vw, 1.35rem); font-weight: 300; color: #dedbd2; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.btn { display: inline-block; padding: 13px 28px; border-radius: 999px; font-size: .98rem; font-weight: 700; text-decoration: none; transition: background .2s ease, color .2s ease, border-color .2s ease; border: 1px solid transparent; }
.btn.solid { background: var(--gold); color: var(--ink); }
.btn.solid:hover { background: var(--gold-light); }
.btn.line { border-color: rgba(255, 255, 255, .4); color: #fff; }
.btn.line:hover { border-color: var(--gold); color: var(--gold-light); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #2a2a2c; }

/* Network drawn from the nodes and links in the logo */
.field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.motif { position: absolute; top: 50%; right: -150px; width: min(52vw, 700px); height: auto; transform: translate3d(var(--mx, 0), calc(-46% + var(--my, 0px) + var(--sy, 0px)), 0); pointer-events: none; }
.motif .links { stroke: var(--gold); stroke-width: 1.2; opacity: .38; }
.motif .soft { stroke: var(--gold); stroke-width: 1; opacity: .16; }
.motif .node { fill: var(--ink); stroke: var(--gold); stroke-width: 1.6; }
.motif .core { fill: var(--gold); animation: pulse 4.5s ease-in-out infinite; }
.motif .core.b { animation-delay: 1.5s; }
.motif .core.c { animation-delay: 3s; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (max-width: 900px) { .motif { width: 560px; right: -240px; top: 34%; opacity: .55; } }
@media (max-width: 640px) { .hero .wrap { padding-top: 72px; padding-bottom: 48px; } .motif { opacity: .32; } }

/* Key facts, part of the hero */
.facts { position: relative; z-index: 1; margin-top: 76px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-dark); }
.fact { padding: 22px 24px 0 0; }
.fact + .fact { padding-left: 28px; border-left: 1px solid var(--line-dark); }
.fact b { display: block; margin-bottom: 4px; color: var(--gold); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; }
.fact span { font-size: 1.12rem; }
@media (max-width: 700px) {
  .facts { grid-template-columns: 1fr; margin-top: 48px; }
  .fact, .fact + .fact { padding: 14px 0; border-left: 0; border-bottom: 1px solid var(--line-dark); }
  .fact:last-child { border-bottom: 0; padding-bottom: 0; }
}

/* Light sections */
.block { padding: 104px 0; }
.block + .block { padding-top: 0; }
.statement { margin-top: 22px; max-width: 24em; font-size: clamp(1.5rem, 3.3vw, 2.5rem); font-weight: 300; line-height: 1.28; letter-spacing: -.012em; }
.note { margin-top: 24px; color: var(--muted); }
@media (max-width: 640px) { .block { padding: 68px 0; } }

/* Kyoto band */
.kyoto {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center;
  min-height: min(68vw, 620px);
  background: var(--ink);
  color: #fff;
}
/* The photo cut into depth layers. At rest they line up into the full picture. */
.kyoto-img { position: absolute; top: -16%; bottom: -16%; left: -28px; right: -28px; }
.kyoto-img i { position: absolute; inset: 0; background: center 60% / cover no-repeat; will-change: transform; }
.kyoto-img .sky { background-image: url("../img/kyoto/sky.webp"); }
.kyoto-img .far { background-image: url("../img/kyoto/far-mountains.webp"); }
.kyoto-img .near { background-image: url("../img/kyoto/near-mountains.webp"); }
.kyoto-img .city { background-image: url("../img/kyoto/city.webp"); }
.kyoto-img .pagoda { background-image: url("../img/kyoto/pagoda.webp"); }
.kyoto-img .forest { background-image: url("../img/kyoto/forest.webp"); }
.kyoto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 15, 16, .88) 0%, rgba(15, 15, 16, .55) 42%, rgba(15, 15, 16, 0) 72%); }
.kyoto .wrap { position: relative; z-index: 1; width: 100%; padding-top: 72px; padding-bottom: 72px; }
.kyoto .eyebrow { color: var(--gold-light); }
.kyoto h2 { margin: 18px 0 16px; font-size: clamp(2.2rem, 5vw, 4.2rem); font-weight: 900; line-height: 1.05; letter-spacing: -.02em; }
.kyoto p:last-child { font-size: clamp(1.05rem, 1.7vw, 1.3rem); font-weight: 300; line-height: 1.45; }
@media (max-width: 640px) {
  .kyoto-img i { background-position: 90% center; }
  .kyoto::after { background: linear-gradient(180deg, rgba(15, 15, 16, .78), rgba(15, 15, 16, .45)); }
}

/* People */
.people { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--text); }
.person { padding: 20px 20px 0 0; }
.person b { display: block; margin-bottom: 6px; color: var(--muted); font-size: .85rem; font-weight: 400; }
.person span { font-size: 1.28rem; font-weight: 700; letter-spacing: -.005em; }
@media (max-width: 900px) { .people { grid-template-columns: repeat(2, 1fr); row-gap: 8px; } }
@media (max-width: 480px) { .people { grid-template-columns: 1fr; } .person span { font-size: 1.15rem; } }

/* Past editions */
.past { padding: 96px 0 104px; background: var(--ink); color: #fff; }
.past .eyebrow { color: var(--gold); }
.past h2 { margin-top: 16px; font-size: clamp(1.9rem, 3.6vw, 3rem); font-weight: 300; letter-spacing: -.015em; }
.editions { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.edition { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--ink-2); color: #fff; text-decoration: none; }
.edition.big { grid-column: span 2; grid-row: span 1; aspect-ratio: auto; }
.edition i { position: absolute; inset: 0; background: center / cover no-repeat; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.edition::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .82)); }
.edition div { position: absolute; left: 18px; right: 18px; bottom: 14px; z-index: 1; }
.edition b { display: block; color: var(--gold-light); font-size: .85rem; letter-spacing: .08em; }
.edition span { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.edition.big span { font-size: 1.8rem; }
.edition small { font-weight: 400; font-size: .82rem; color: #d8d8d8; }
.edition:hover i { transform: scale(1.05); }
.edition:focus-visible { outline-offset: 2px; }
@media (max-width: 800px) {
  .past { padding: 68px 0 72px; }
  .editions { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .edition.big { aspect-ratio: 16 / 9; }
  .edition span, .edition.big span { font-size: 1.1rem; }
}

/* Follow band */
.follow { background: var(--gold); color: var(--ink); padding: 52px 0; }
.follow .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px; }
.follow h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 900; letter-spacing: -.01em; }
.follow p { margin-top: 4px; }

/* Footer */
.foot { background: var(--ink); color: #a9a79f; padding: 28px 0; font-size: .9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.foot a { color: #e8e6df; }
.foot a:hover { color: var(--gold-light); }

/* Scroll position, a thin gold line under the top bar */
.bar .progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; }

/* Scroll reveals. Only hidden once the script has confirmed it is running. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Gentle entrance */
.rise { animation: rise .7s cubic-bezier(.2, .7, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .motif .core { animation: none; }
  .edition i, .bar nav a, .btn { transition: none; }
}
