/* ============================================================
   CSS adapted from irid website: https://irid.space/
   ============================================================ */

/* --- Fonts ------------------------------------------------ */
@font-face {
  font-family: 'BDO Grotesk';
  src: url('../fonts/BDOGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BDO Grotesk';
  src: url('../fonts/BDOGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand colors from wordmark */
  --magenta:   #D464AB;
  --orange:    #FE724A;
  --green:     #13BC6D;
  --cyan:      #32A8DA;

  /* UI */
  --black:     #1A1A1A;
  --mid:       #6B6B6B;
  --light:     #C8C8C8;
  --white:     #FFFFFF;
  --bg:        #FFFFFF;

  /* Layout */
  --sidebar-w: 340px;
  --nav-col-w: 200px;
  --content-x: 80px;
  --content-max: 640px;

  /* Typography */
  --font: 'BDO Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --size-wordmark: clamp(18px, 2.5vw, 24px);
  --size-body:     14px;
  --size-nav:      14px;
  --size-label:    14px;
  --lh-body:       1.65;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: var(--size-body);
  color: var(--black);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* --- Layout — fixed sidebar + scrollable content ----------- */
.layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* --- Sidebar ---------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 80px 40px 48px 80px;
  z-index: 10;
  overflow: visible;
}

.wordmark,
a.wordmark {
  display: block;
  font-size: 24px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: -0.01em;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}

a.wordmark:hover { opacity: 0.85; }

.wordmark .w-preposition { color: var(--black); }
.wordmark .w-magenta     { color: var(--magenta); }
.wordmark .w-orange      { color: var(--orange); }
.wordmark .w-green       { color: var(--green); }
.wordmark .w-cyan        { color: var(--cyan); }

.sidebar-illustration {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 120%;
  height: 78%;
  pointer-events: none;
  overflow: visible;
}

.sidebar-illustration img,
.sidebar-illustration svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left bottom;
}

/* --- Nav column ------------------------------------------- */
.nav-col {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  width: var(--nav-col-w);
  height: 100vh;
  padding: 80px 0 48px 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.nav-col nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-col a {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: var(--size-nav);
  font-family: var(--font);
  color: var(--light);
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 2px 0;
  overflow: hidden;
}

.nav-col a:hover { color: var(--black); }
.nav-col a.active { color: var(--black); }

.nav-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  background: var(--black);
  flex-shrink: 0;
  margin-right: 8px;
}

.nav-col a.active .nav-dot {
  transform: translateX(0);
  opacity: 1;
}

.nav-col a:not(.active) .nav-dot {
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav-col a:not(.active):hover .nav-dot {
  transform: translateX(0);
  opacity: 1;
}

/* --- Main content ----------------------------------------- */
.main {
  margin-left: calc(var(--sidebar-w) + var(--nav-col-w));
  height: 100vh;
  overflow-y: auto;
  padding: 80px var(--content-x) 120px var(--content-x);
  scroll-behavior: smooth;
}

.main { scrollbar-width: none; -ms-overflow-style: none; }
.main::-webkit-scrollbar { display: none; }

.content {
  max-width: var(--content-max);
  animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Typography ------------------------------------------- */
.content h1 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 1.2em;
  color: var(--black);
  line-height: 1.4;
}

.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  font-weight: 500;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
  color: var(--black);
}

.content h2 { font-size: 18px; }
.content h3 { font-size: 16px; }
.content h4 { font-size: 15px; }
.content h5 { font-size: 14px; }
.content h6 { font-size: 13px; }

.content p {
  font-size: var(--size-body);
  line-height: var(--lh-body);
  color: var(--black);
  margin-bottom: 1.5em;
}

.content ul,
.content ol {
  margin: 0 0 1.5em 0;
  padding: 0;
  list-style: none;
}

.content ul li,
.content ol li {
  position: relative;
  padding-left: 1.2em;
  line-height: var(--lh-body);
  margin-bottom: 0.3em;
  font-size: var(--size-body);
  color: var(--black);
}

.content ul li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--black);
}

.content ol {
  counter-reset: item;
}

.content ol li::before {
  counter-increment: item;
  content: counter(item) '.';
  position: absolute;
  left: 0;
  color: var(--black);
}

.content a {
  /* text-decoration: underline; */
  text-underline-offset: 3px;
  color: var(--black);
}


.content blockquote {
  margin-bottom: 1.5em;
  padding-left: 1.2em;
  border-left: 1px solid var(--light);
}

.content blockquote p {
  margin-bottom: 0.5em;
}

.content blockquote p:last-child {
  margin-bottom: 0;
}

.content > *:last-child,
.content > *:last-child > *:last-child {
  margin-bottom: 0;
}

/* --- Page components -------------------------------------- */
.page-title {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 1.2em;
  color: var(--black);
}

.cover {
  margin: 0 0 2rem;
}

.cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* --- Table ------------------------------------------------ */
.table-section {
  margin-bottom: 2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--size-body);
}

.table th,
.table td {
  padding: 8px 12px;
  border: 1px solid var(--light);
  vertical-align: top;
  text-align: left;
}

.table__key {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  width: 120px;
  color: var(--mid);
}

.table__value p,
.table__value ul,
.table__value ol {
  margin-bottom: 0.75em;
}

.table__value > *:last-child {
  margin-bottom: 0;
}

.table__value ul li,
.table__value ol li {
  margin-bottom: 0.15em;
}

/* --- Blocks ----------------------------------------------- */
.block {
  margin-bottom: 2rem;
}

.block__title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 0.8em;
  color: var(--black);
}

.block__body p,
.block__body ul,
.block__body ol,
.block__body blockquote {
  margin-bottom: 1rem;
}

.block__body > *:last-child {
  margin-bottom: 0;
}

.block__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.block__caption
/* .block--image figcaption, */
{
  margin-top: 0.5rem;
  color: var(--light);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.block__caption p,
.block--image figcaption p {
  color: var(--light);
  transition: color 0.2s ease;
}

.block--image:hover .block__caption,
.block--image:hover figcaption,
.block__caption:hover,
.block--image figcaption:hover {
  color: var(--black);
}

.block--image:hover .block__caption p,
.block--image:hover figcaption p,
.block__caption:hover p,
.block--image figcaption:hover p {
  color: var(--black);
}

/* --- Link card -------------------------------------------- */
.link-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--light);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.link-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.link-card__image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 320px;
  object-fit: cover;
}

.link-card__content { padding: 1rem; }

.link-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.link-card__description {
  margin: 0 0 0.5rem;
  color: var(--mid);
  font-size: 0.95rem;
}

.link-card__description p:last-child { margin-bottom: 0; }

.link-card__url {
  display: block;
  color: var(--mid);
  font-size: 0.85rem;
  word-break: break-all;

  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Attachment ------------------------------------------- */
.attachment {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--light);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.attachment__thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.attachment__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.attachment__name { font-weight: 500; }

.attachment__meta {
  color: var(--mid);
  font-size: 0.85rem;
}

/* --- Embed ------------------------------------------------ */
.block__embed iframe,
.block__embed video,
.block__embed img {
  max-width: 100%;
}

/* --- Utilities -------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.error { color: #b00; }

/* --- Channel input ---------------------------------------- */
.channel-input {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--light);
}

.channel-input__label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
}

.channel-input__form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.channel-input__field {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 240px;
  border: 0;
  border-bottom: 1px solid var(--light);
  border-radius: 0;
  padding: 0 0 4px 0;
  background: transparent;
  font: inherit;
  font-size: var(--size-body);
  color: var(--black);
  outline: none;
}

.channel-input__field::placeholder {
  color: var(--light);
}

.channel-input__field:focus {
  border-bottom-color: var(--black);
}

.channel-input__field.is-error {
  border-bottom-color: #b00;
}

.channel-input__button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
}

.channel-input__button:hover {
  color: var(--mid);
}

.channel-input__error {
  margin-top: 0.75rem;
  color: #b00;
  font-size: var(--size-body);
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 1060px) {
  :root {
    --size-body: 14px;
    --size-nav:  14px;
  }

  html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .layout {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 24px 24px 0;
    flex-direction: column;
  }

  .sidebar-illustration {
    position: relative;
    width: 100%;
    height: auto;
    order: -1;
    overflow: visible;
  }

  .sidebar-illustration {
    display: none;
  }
  /* .sidebar-illustration img, */
  /* .sidebar-illustration svg { */
  /*   width: 100%; */
  /*   height: auto; */
  /*   object-fit: contain; */
  /*   object-position: left top; */
  /* } */

  .wordmark { margin-top: 24px; }

  .nav-col {
    position: relative;
    left: 0;
    width: 100%;
    height: auto;
    padding: 16px 24px;
  }

  .nav-col nav {
    flex-direction: column;
    gap: 4px;
  }

  .main {
    margin-left: 0;
    height: auto;
    overflow-y: visible;
    padding: 32px 24px 80px;
  }
}

@media (max-width: 768px) {
  .sidebar-illustration {
    display: none;
  }
}
