* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.spimg {
    background-color: #FC4120;
    width: 40vw;
    height: 100%;
    border: 2px solid #555;
}

#DSimgC {
    width: 40vw;
    height: 100%;
    overflow: hidden;
    display: block;
    flex-shrink: 0;
}

#DSimg {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.right-header {
    margin-left: 50vw;
}

.text1 {
    margin-left: 10vw;
}

.text2 {
    margin-right: 10vw;
}

h1 {
    margin-top: 4rem;
}

h1, h2 {
    margin-left: 4rem;
}

h3 {
    /* margin-bottom: 2rem; */
    font-size: 1.5rem;
    /* font-family: SinclairQL; */
    /* margin-top: -1.5rem; */
}


a {
    text-decoration: none;
    color: inherit;
}

body {
    padding-bottom: 8rem;
}

.explanation {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: -100vh;
    right: 0;
    width: 100vw;
    height: 100vh;
    padding: 12rem;
    color: #fdfdfd;
    z-index: 4;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #333;
    opacity: .0;
    z-index: -1;
}

.overlay, .explanation, #o-off {
    transition: .4s ease-in-out;
}

.visible {
    z-index: 3;
    opacity: .97;
}

.in-screen {
    top: 0;
}

#o-off {
    position: fixed;
    top: 4rem;
    right: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    z-index: -1;
    background-color: #fdfdfd;
    color: #555;
    font-weight: 900;
    opacity: 0;
    border: none;
}

.on {
    z-index: 4 !important;
    opacity: 1 !important;
}


.sandbox-btn, #o-btn {
    background-color: #eee;
    border-radius: .5rem;
    padding: .5rem;
    transition: .1s linear;
    margin-left: 2rem;
    border: none;
}

.sandbox-btn:hover {
    background-color: #ddd;
}


.spc {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  background: #eee;
  border-radius: 1rem;
  transition: .1s linear;
  margin-top: 2rem;
  height: 100%;
}

.spc:hover {
    background-color: #ddd;
}


.subpages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42ch, 1fr));
  gap: 4rem;
  align-items: stretch;
  width: 100%;
  grid-auto-rows: minmax(4rem, auto);
  padding: 4rem;
}

.subpages > a.spc {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 4rem;
  background: #eee;
  border-radius: 1rem;
  margin: 0;
  text-align: center;
  hyphens: auto;
  overflow-wrap: anywhere;
}

.wrapper {                     /* whatever wraps your grid */
  inline-size: min(100%, 100dvw);   /* never exceed viewport width */
  margin-inline: auto;
  padding: clamp(1rem, 4vw, 4rem);
  padding-left: calc(clamp(1rem, 4vw, 4rem) + env(safe-area-inset-left));
  padding-right: calc(clamp(1rem, 4vw, 4rem) + env(safe-area-inset-right));
}

h3 { 
    hyphens: auto;
    overflow-wrap: anywhere;
}

/* If you prefer a hard switch to single column at a breakpoint */
@media (max-width: 640px){
    .subpages{ 
        grid-template-columns: 1fr;
        padding: .5rem;
    }

    h3 {
        font-size: small;
    }

    h1, h2 {
        margin-left: 0;
        width: 100vw;
        display: flex;
        justify-content: center;
    }

    .spc {
        padding: 1rem;

    }

    .subpages > a.spc{
        display: flex;
        align-items: center;
        justify-content: center;
        
        background: #eee;
        border-radius: 1rem;
        height: 100%;
        min-width: 0;
        text-align: center;
        overflow-wrap: anywhere;
        
        margin: 0;
    }
}