:root {
  --cream: #f5f0e6;
  --ink: #1c1b18;
  --muted: #6f6a61;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--cream);
}

body {
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 48fr) minmax(360px, 52fr);
  background: var(--cream);
}

.doodle-area {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

#doodle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  touch-action: none;
}

#doodle canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  touch-action: none;
}

.profile {
  min-width: 0;
  display: flex;
  align-items: center;
  padding:
    max(32px, env(safe-area-inset-top))
    max(46px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom))
    clamp(8px, 1.3vw, 22px);
}

.profile-copy {
  width: min(100%, 500px);
}

h1 {
  margin: 0;
  font-size: clamp(42px, 4.3vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.052em;
  font-weight: 735;
}

.role {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.25vw, 16px);
  line-height: 1.45;
  font-weight: 520;
}

.role-link {
  color: inherit;
  text-decoration: none;
}

.role-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.email-row,
.supplementary {
  margin: 0;
}

.email-row {
  margin-top: 22px;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 620;
  text-decoration: none;
}

.icon-mail {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-block;
  background: url('/svg/Orion_mail_over.svg') center / contain no-repeat;
}

.supplementary {
  margin-top: 38px;
}

.supplementary-link {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
}

.supplementary-title {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
}

.supplementary-path {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
}

.email-link:hover,
.supplementary-link:hover .supplementary-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid rgba(28, 27, 24, 0.28);
  outline-offset: 4px;
}

@media (max-width: 820px) {
  .site-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 285px auto;
  }

  .doodle-area {
    min-height: 285px;
    height: 285px;
  }

  .profile {
    align-items: flex-start;
    padding:
      8px
      max(24px, env(safe-area-inset-right))
      max(42px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
  }

  h1 {
    font-size: clamp(40px, 10.5vw, 56px);
  }
}

@media (max-width: 520px) {
  .site-shell {
    grid-template-rows: 255px auto;
  }

  .doodle-area {
    min-height: 255px;
    height: 255px;
  }

  .profile {
    padding-top: 6px;
  }

  .supplementary {
    margin-top: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}


/* Summer school supplementary page */
.materials-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(28px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  background: var(--cream);
}

.materials {
  width: min(100%, 620px);
}

.materials h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 735;
}

.materials-day {
  margin-top: 34px;
}

.materials-day h2 {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 680;
}

.material-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 13px;
  color: var(--ink);
  text-decoration: none;
}

.material-link-title {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 620;
}

.material-link-path {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.material-link:hover .material-link-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}


/* 404 page */
.not-found-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(28px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  background: var(--cream);
}

.not-found {
  width: min(100%, 520px);
}

.not-found h1 {
  margin: 0;
  font-size: clamp(52px, 8vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-weight: 735;
}

.not-found-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 520;
}

.not-found-link {
  display: inline-block;
  margin-top: 34px;
  color: var(--ink);
  text-decoration: none;
}

.not-found-link-title {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 620;
}

.not-found-link-path {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
}

.not-found-link:hover .not-found-link-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}


.materials-return-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: 82px;
}

.materials-return {
  display: inline-block;
  color: var(--muted);
  text-align: right;
  text-decoration: none;
}

.materials-return-title {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
}

.materials-return-path {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  font-weight: 450;
}

.materials-return:hover {
  color: var(--ink);
}

.materials-return:hover .materials-return-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.materials-disclaimer {
  max-width: 540px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 500;
}
