*, *::after, *::before { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; font-size: 16px; line-height: 1.618; display: flex; flex-flow: column nowrap; min-height: 100vh; } .header, .main, .footer { width: min(calc(100vw - 2rem), 350px); margin-left: auto; margin-right: auto; } .header, .main { border: 3px solid hsl(219, 64%, 35%); border-radius: 5px; box-shadow: 2px 2px 0 0 hsl(219, 64%, 35%), 2px 2px 2px 0 hsl(219, 64%, 30%), 3px 3px 3px 0 hsla(219, 64%, 25%, 0.65); } .header { background: hsl(219, 64%, 35%); border-bottom-left-radius: 0; border-bottom-right-radius: 0; color: hsl(0, 0%, 100%); margin-top: 2rem; padding: 0.5rem 1rem; } .branding { font-size: 1.5rem; font-variant: small-caps; letter-spacing: 1px; text-align: center; text-shadow: 1px 1px 0 hsl(0, 0%, 65%), 2px 2px 2px hsl(0, 0%, 0%); } .main { background: hsl(0, 0%, 97%); border-top-left-radius: 0; border-top-right-radius: 0; margin-bottom: 1rem; } .footer { font-size: 0.9rem; text-align: center; margin-top: auto; padding: 1rem 0; } .calculator { padding: 1rem; } .calculator__display { background: hsl(0, 0%, 100%); border: 1px solid hsl(0, 0%, 60%); border-radius: 2px; box-shadow: inset 0 0 2px 0 hsl(0, 0%, 70%), 0 0 0 1px hsl(0, 0%, 75%); font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 600; text-align: right; width: 100%; margin-bottom: 1rem; padding: 0.2rem 1rem; } .calculator__entry-pad { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 6fr; gap: 1rem; justify-items: end; } .calculator__clear { grid-column: 3 / 5; grid-row: 1; display: flex; flex-flow: row nowrap; justify-content: flex-end; gap: 1rem; } .calculator__digits { grid-column: 1 / 4; grid-row: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } .calculator__operations { grid-column: 4; grid-row: 2; display: flex; flex-flow: column nowrap; gap: 1rem; } .btn { display: block; padding: clamp(0.1rem, 5vw, 0.3rem) clamp(1rem, 6vw, 1.5rem); background: hsl(0, 0%, 95%); border: 1px solid hsl(0, 0%, 85%); border-radius: 3px; box-shadow: 0 0 2px hsl(0, 0%, 80%), 0 0 0 2px hsl(0, 0%, 60%), 1px 1px 0 3px hsl(0, 0%, 50%); font-family: inherit; font-size: inherit; line-height: inherit; cursor: pointer; transition: all 0.15s ease-in-out 0s; } .btn:hover, .btn:focus { background: hsl(0, 0%, 100%); } .btn:focus { outline: 3px solid hsl(219, 64%, 35%); } .btn:active { background: hsl(0, 0%, 90%); box-shadow: 0 0 0 hsl(0, 0%, 80%), 0 0 0 2px hsl(0, 0%, 80%), 0 0 0 3px hsl(0, 0%, 50%); outline: none; transform: translateX(2px) translateY(2px) scale(0.96); }