* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    min-height: 100vh;
    padding: 2rem;
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header {
    margin-bottom: 2rem;
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: inline-block;
    margin-bottom: 1rem;
}

.back-link:hover {
    opacity: 1;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    border: 3px solid #fff;
    padding: 1rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.calculator {
    background: rgba(255,255,255,0.05);
    border: 2px solid #fff;
    padding: 2rem;
    margin: 2rem 0;
}

.calc-header {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.composition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1rem;
    position: relative;
}


.input-group::after {
    content: "▾";
    position: absolute;
    right: 0.75rem;
    bottom: 0.7rem;
    color: #fff;
    pointer-events: none;
}
.input-group-inline {
    display: flex;
    gap: 1rem;
}

.input-group-inline > div {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="number"] {
    width: 100%;
    background: #000;
    border: 2px solid #fff;
    color: #fff;
    padding: 0.6rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s;

    /* Firefox: remove arrows */
    -moz-appearance: textfield;
}

input[type="number"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

/* Chrome, Safari, Edge, Opera: remove arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

button {
    background: #fff;
    color: #000;
    border: 2px solid #fff;
    padding: 1rem 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

button:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #fff;
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.secondary {
    background: #000;
    color: #fff;
}

button.secondary:hover {
    background: #fff;
    color: #000;
}

.results {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.1);
    border-left: 4px solid #fff;
    display: none;
}

.results.visible {
    display: block;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.result-item {
    padding: 0.75rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.result-label {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.info-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.02);
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.status {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 2rem;
}

.error-message {
    background: rgba(255,0,0,0.2);
    border: 2px solid rgba(255,0,0,0.5);
    color: #fff;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.error-message.visible {
    display: block;
}

.preset-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.preset-buttons button {
    flex: 0 1 auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

select {
    width: 100%;
    background: #000;
    border: 2px solid #fff;
    color: #fff;
    padding: 0.6rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
}

select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

/* ===== Landing / Depth Page Styles ===== */

.content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
    border: 4px solid #fff;
    padding: 1.5rem;
    display: inline-block;
}

.tagline {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.description {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    margin-bottom: 3rem;
    max-width: 600px;
    line-height: 1.6;
    opacity: 0.9;
}

.layers {
    margin: 3rem 0;
    border-left: 4px solid #fff;
    padding-left: 2rem;
}

.layer {
    margin: 1rem 0;
    font-size: 1rem;
}

.layer-name {
    font-weight: 700;
    display: inline-block;
    width: 150px;
}

.links {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.links a {
    color: #000;
    background: #fff;
    text-decoration: none;
    font-size: 1rem;
    padding: 1rem 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid #fff;
    transition: all 0.2s;
    margin-right: -2px;
}

.links a:hover {
    background: #000;
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 4px 0 #fff;
}

.depth-indicator {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-top: 4rem;
}

.wasm-status {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 1rem;
}
.centered-page {
    display: flex;
    align-items: center;
    justify-content: center;
}
