/* ==========================================================================
   Components — lay-ui
   ========================================================================== */

/* ---- Hero Card ---- */
.hero-card {
  width: 528px;
  position: relative;
}

.hero-card__bg {
  background: var(--terra-480);
  box-shadow: var(--shadow-hero);
  padding: 32px 64px 40px;
  position: relative;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card .pill-btn {
  position: absolute;
  top: 16px;
  right: 16px;
}

.hero-card__content {
  text-align: center;
}

.hero-card__greeting {
  color: var(--terra-960);
  margin-bottom: 16px;
}

.hero-card__headline {
  color: var(--terra-960);
  max-width: 400px;
  margin: 0 auto 24px;
}

.hero-card__sub {
  color: var(--terra-960);
  max-width: 250px;
  margin: 0 auto;
}

/* ---- Pill Button ---- */
.pill-btn {
  width: 36px;
  height: 40px;
  border-radius: 18px;
  background: var(--terra-100);
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0px 0.5px 2px 0px var(--terra-560);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.pill-btn::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 14px;
  background: transparent;
}

.pill-btn:hover {
  transform: scale(1.06);
  box-shadow: inset 0px 0.5px 3px 0px var(--terra-560);
}

.pill-btn:active {
  transform: scale(0.95);
}

.pill-btn__icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

/* ---- Projects Button ---- */
.projects-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 32px 4px 8px;
  background: var(--terra-320);
  border: 2px solid var(--terra-960);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.projects-btn__label {
  color: var(--terra-960);
  opacity: 0.8;
}

.projects-btn__icon {
  color: var(--terra-960);
  opacity: 0.8;
  width: 20px;
  height: 20px;
}

.projects-btn:hover {
  opacity: 0.85;
}

/* ---- About Card ---- */
.about-card {
  background: var(--terra-160);
  box-shadow: var(--shadow-card);
  width: 384px;
  padding: 32px;
}

.about-card--short {
  min-height: 184px;
}

.about-card--long {
  min-height: 656px;
}

.about-card__text {
  color: var(--terra-960);
  width: 320px;
  line-height: 1.4;
}

.about-card__divider {
  width: 320px;
  height: 1px;
  border-bottom: 1px dotted var(--terra-800);
  margin: 24px 0;
}

.about-card__divider--full {
  width: calc(100% + 64px);
  margin-left: -32px;
  border-bottom: 1px dashed var(--terra-800);
}

/* ---- Spectrum Visualization ---- */
.spectrum {
  width: 458px;
}

.spectrum__frame {
  position: relative;
  width: 458px;
  height: 308px;
}

.spectrum__bg {
  position: absolute;
  inset: 0;
  background: var(--surface-bg);
  box-shadow: var(--shadow-inset);
}

.spectrum__inner {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: var(--terra-160);
}

.spectrum__gradient {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 24px;
  width: 64px;
  height: 226px;
  background: linear-gradient(to bottom, rgba(178, 48, 0, 0.1), #B23000);
  opacity: 0.1;
}

.spectrum__grid {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(8, 24px);
  grid-template-rows: repeat(7, 24px);
  gap: 8px;
}

.spectrum__cell {
  width: 24px;
  height: 24px;
}

.spectrum__label {
  position: absolute;
  white-space: nowrap;
}

.spectrum__label--left {
  color: #266067;
  left: 22px;
  bottom: 48px;
}

.spectrum__label--right {
  color: #A8756D;
  right: 22px;
  top: 24px;
}

.spectrum__footer {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.spectrum__footer-line {
  width: 65px;
  height: 0;
  border-top: 2px dashed var(--terra-960);
}

.spectrum__link {
  color: var(--terra-960);
}

/* ---- Contact Card ---- */
.contact-card {
  background: var(--terra-100);
  padding: 8px;
  box-shadow: var(--shadow-card);
}

.contact-card--collapsed {
  width: 384px;
}

.contact-card__border {
  border: 1px solid var(--terra-800);
  padding: 24px 24px 8px;
  display: flex;
  flex-direction: column;
}

.contact-card__intro {
  color: var(--terra-960);
  width: 336px;
  margin-bottom: 40px;
}

.contact-card__action-wrap {
  position: relative;
  margin-bottom: 72px;
}

.contact-card__action-line {
  position: absolute;
  top: -8px;
  left: -24px;
  right: -24px;
  height: 0;
  border-top: 1px solid var(--terra-800);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-card__action {
  color: var(--terra-960);
  display: inline-block;
}

/* Micro text-morph animation */
@keyframes action-morph {
  0%   { opacity: 1; transform: translateY(0); }
  40%  { opacity: 0; transform: translateY(-6px); }
  60%  { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.contact-card__action--morphing {
  animation: action-morph 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Contact footer */
.contact-card__footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
}

.contact-card__footer-line {
  position: absolute;
  top: 0;
  left: -24px;
  right: -24px;
  height: 0;
  border-top: 1px dotted var(--terra-800);
}

.contact-card__footer-line--dashed {
  border-top-style: dashed;
}

.contact-card__footer-left {
  color: var(--terra-960);
}

.contact-card__footer-right {
  color: var(--terra-960);
  text-align: right;
}

/* ---- Contact Form ---- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.contact-form__line {
  width: 100%;
  height: 0;
  border-top: 1px solid var(--terra-800);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-form__fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-form__field {
  position: relative;
}

.contact-form__input-area {
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-form__label {
  display: block;
  color: var(--terra-960);
  margin-top: 2px;
}

.contact-form__required {
  opacity: 0.5;
}

/* Editable field inputs */
.contact-form__input {
  display: block;
  width: 320px;
  margin-top: 4px;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--terra-960);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.72px;
  line-height: 1;
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
  resize: none;
  overflow: hidden;
}

.contact-form__input::placeholder {
  color: var(--terra-960);
  opacity: 0.35;
}

.contact-form__input:focus {
  color: var(--terra-960);
}

.contact-form__input:focus-visible {
  outline: 2px solid var(--terra-720);
  outline-offset: 2px;
}

/* Focus: highlight the line above the active field */
.contact-form__field:focus-within .contact-form__line {
  border-top-color: var(--terra-960);
}

textarea.contact-form__input {
  min-height: 72px;
  line-height: 1.2;
  field-sizing: content;
}

/* Tags */
.contact-form__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  width: 320px;
}

.contact-form__tags--dim {
  opacity: 0.6;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 2px solid var(--terra-480);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.48px;
  color: var(--terra-480);
  cursor: pointer;
  background: transparent;
  transition:
    transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.2s ease,
    color 0.2s ease;
}

.tag--active {
  border-color: var(--terra-960);
  color: var(--terra-960);
}

.tag:hover:not(.tag--active) {
  border-color: var(--terra-720);
  color: var(--terra-720);
}

/* Submit */
.contact-form__submit {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 8px;
  color: var(--terra-960);
  cursor: pointer;
  transition: gap 0.2s ease;
}

.contact-form__submit:hover {
  gap: 6px;
}

.contact-form__submit-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.contact-form__submit svg {
  color: var(--terra-960);
}

.contact-form__submit-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--terra-960);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: -0.24px;
  text-transform: capitalize;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 12%;
}


/* ==========================================================================
   Components — Projects Page
   ========================================================================== */

/* ---- Nav Button ---- */

.nav-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  border: 2px solid var(--grey-880);
  padding: 4px 32px 4px 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.nav-btn__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: white;
}

.nav-btn__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--texture-paper);
  background-size: 1024px 1024px;
  background-position: top left;
  mix-blend-mode: color-burn;
  opacity: 0.40;
}

.nav-btn__content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.80;
}

.nav-btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  font-size: 20px;
  line-height: 1;
  color: var(--grey-480);
}

.nav-btn__icon--muted { color: var(--grey-640); }

.nav-btn__label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 640;
  font-variation-settings: 'wdth' 120, 'wght' 640, 'GRAD' 64, 'opsz' 18;
  letter-spacing: -0.24px;
  color: var(--grey-480);
  text-transform: capitalize;
  white-space: nowrap;
  line-height: 1;
}

.nav-btn__label--underline {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.nav-btn__label--muted {
  color: var(--grey-640);
}

.nav-btn__date {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.12px;
  color: var(--grey-480);
  text-align: right;
  white-space: nowrap;
  line-height: 1;
}


/* ---- Paper Background (shared) ---- */

.paper-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.paper-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
}
.paper-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--texture-paper);
  background-size: 1024px 1024px;
  background-position: top left;
  mix-blend-mode: color-burn;
  opacity: 0.32;
}


/* ---- About Card (Projects Page) ---- */

.about-card-p {
  position: relative;
  border: 2px solid var(--mint-100);
  padding: 48px;
  display: inline-flex;
  flex-direction: column;
  gap: 32px;
  width: 432px;
}

.about-card-p__text {
  position: relative;
  width: 336px;
  color: var(--grey-400);
}

.about-card-p__quote {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.12px;
  line-height: 1.2;
  white-space: nowrap;
}

.about-card-p__heading {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 500;
  font-variation-settings: 'wght' 500, 'GRAD' 0, 'opsz' 18;
  letter-spacing: -0.48px;
  line-height: 1.2;
  margin-top: 12px;
  width: 336px;
}

.about-card-p__body {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.12px;
  line-height: 1.2;
  margin-top: 12px;
  width: 250px;
}

.about-card-p__divider {
  position: relative;
  width: 336px;
  height: 1px;
  background: var(--grey-320);
  opacity: 0.4;
  flex-shrink: 0;
}

.about-card-p__cta {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.12px;
  color: var(--grey-320);
  line-height: 1.2;
  width: 292px;
  position: relative;
}


/* ---- Project Card ---- */

.project-card {
  position: relative;
  width: 408px;
  height: 176px;
  border-width: 1px;
  border-style: solid;
  flex-shrink: 0;
  overflow: hidden;
}

.project-card--terra {
  background: var(--yellow-100);
  border-color: var(--yellow-800);
}
.project-card--blue {
  background: var(--blue-80);
  border-color: var(--blue-800);
}

.project-card__title {
  position: absolute;
  top: 16px;
  left: 24px;
  width: 308px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.72px;
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
  line-height: 1.2;
}
.project-card--terra .project-card__title { color: var(--terra-720); }
.project-card--blue  .project-card__title { color: var(--blue-800); }

.project-card__body {
  position: absolute;
  top: 88px;
  left: 24px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.12px;
  line-height: 1.2;
}
.project-card--terra .project-card__body { color: var(--terra-720); width: 304px; }
.project-card--blue  .project-card__body { color: var(--blue-800); width: 244px; }

.project-card__divider {
  position: absolute;
  top: 130px;
  left: 16px;
  width: 376px;
  height: 1px;
  opacity: 0.35;
}
.project-card--terra .project-card__divider { background: var(--terra-720); }
.project-card--blue  .project-card__divider { background: var(--blue-800); }

.project-card__footer {
  position: absolute;
  top: 138px;
  left: 24px;
  display: flex;
  align-items: center;
}

.project-card__role {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 720;
  font-variation-settings: 'wdth' 120, 'wght' 720, 'GRAD' 64, 'opsz' 18;
  letter-spacing: -0.24px;
  line-height: 1.2;
  text-transform: capitalize;
  white-space: nowrap;
}
.project-card--terra .project-card__role { color: var(--terra-720); }
.project-card--blue  .project-card__role { color: var(--blue-800); }

.project-card__arrow {
  width: 20px;
  height: 20px;
  transform: rotate(180deg);
  display: block;
  flex-shrink: 0;
}

/* Illustrations */
.project-card__illus {
  position: absolute;
  pointer-events: none;
}
.project-card__illus--hov {
  top: 20px;
  right: 62px;
  width: 20px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card__diamond {
  width: 18px;
  height: 18px;
  background: var(--terra-720);
  transform: rotate(41deg);
  border-radius: 2px;
  flex-shrink: 0;
}
.project-card__illus--notes {
  top: 62px;
  left: 288px;
  width: 104px;
  height: 56px;
}
.project-card__illus--notes img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ---- Archive Entry ---- */

.ap-entry {
  position: absolute;
  left: 16px;
  width: 240px;
  display: flex;
  flex-direction: column;
}

.ap-entry__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.28px;
  color: var(--grey-320);
  line-height: 1.2;
  height: 40px;
}

.ap-entry__meta {
  display: flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  font-variation-settings: 'wght' 500, 'opsz' 18;
  letter-spacing: -0.24px;
  line-height: 1.2;
  white-space: nowrap;
}

.ap-entry__meta .material-icons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.ap-entry--yellow .ap-entry__meta { color: var(--yellow-800); }
.ap-entry--olive  .ap-entry__meta { color: var(--olive-800); }
.ap-entry--mint   .ap-entry__meta { color: var(--mint-800); }


/* ==========================================================================
   Responsive — Mobile (About page components)
   ========================================================================== */

@media (max-width: 767px) {

  /* ---- Hero Card ---- */
  .hero-card {
    width: 100%;
  }

  .hero-card__bg {
    padding: 24px 24px 32px;
  }

  .hero-card__headline {
    max-width: none;
  }

  .hero-card__sub {
    max-width: none;
  }

  /* ---- About Card ---- */
  .about-card {
    width: 100%;
    padding: 24px;
  }

  .about-card__text {
    width: auto;
  }

  .about-card__divider {
    width: auto;
  }

  .about-card__divider--full {
    width: calc(100% + 48px);
    margin-left: -24px;
  }

  /* ---- Spectrum ---- */
  .spectrum {
    width: 100%;
  }

  .spectrum__frame {
    width: 100%;
  }

  /* ---- Contact Card ---- */
  .contact-card--collapsed {
    width: 100%;
  }

  .contact-card__intro {
    width: auto;
    margin-bottom: 32px;
  }

  .contact-card__action-wrap {
    margin-bottom: 40px;
  }

  /* ---- Contact Form ---- */
  .contact-form__input {
    width: 100%;
  }

  .contact-form__tags {
    width: 100%;
  }

}


/* ==========================================================================
   Responsive — Works page about-card-p (flows outside scaled index)
   ========================================================================== */

@media (max-width: 1023px) {

  .about-card-p {
    width: 100%;
    padding: 24px;
  }

  .about-card-p__text {
    width: auto;
  }

  .about-card-p__quote {
    white-space: normal;
  }

  .about-card-p__heading {
    width: auto;
  }

  .about-card-p__body {
    width: auto;
  }

  .about-card-p__divider {
    width: 100%;
  }

  .about-card-p__cta {
    width: auto;
  }
}


/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .pill-btn,
  .projects-btn,
  .contact-card__action-line,
  .contact-form__line,
  .contact-form__input-area,
  .tag,
  .contact-form__submit,
  .nav-btn {
    transition: none;
  }

  .contact-card__action--morphing {
    animation: none;
  }
}
